Loading...

C Multiple Choice Questions

Our C questions and answers focuses on all areas of C programming language covering 100+ topics in C

C Fundamentals-1 MCQs

C Fundamentals Page-4


1. If integer needs two bytes of storage, then maximum value of an unsigned integer is

a) 216 – 1
b) 215 – 1
c) 215
d) 216



2. What is the correct value to return to the operating system upon the successful completion of a program?

a) 1
b) -1
c) 0
d) 2



3. Which is the only function all C programs must contain?

a) start()
b) system()
c) main()
d) printf()



4. Which of the following is not a correct variable type?

a) real
b) float
c) int
d) double



5. What number would be shown on the screen after the following statements of C are executed?

char ch;
int i;
ch = 'G;
i = ch - 'A;
printf("%d", i);

a) 6
b) 5
c) 1
d) None of these.



6. Which of following is not a valid name for a C variable?

a) ALgbly
b) Alg_bly
c) Alg bly
d) both a and b



7. Find the output of the following program.

void main(){
    int i = 01289;
    printf("%d", i);
}

a) 0289
b) 1289
c) 723
d) Syntax error



8. A C variable cannot start with

void main(){
    int i = 065, j = 65;
    printf("%d %d", i, j);
}

a) 53 65
b) 65 65
c) 053 065
d) Syntax error



9. If ASCII value of 'x' is 120, then what is the value of the H, if H = ('x' – 'w' ) / 3;

a) 1
b) 2
c) 3
d) 0



10. What is the difference between a declaration and a definition of a variable?

a) Both can occur multiple times, but a declaration must occur first.
b) A definition occurs once, but a declaration may occur many times.
c) A declaration occurs once, but a definition may occur many times.
d) There is no difference between them.
e) Both can occur multiple times, but a definition must occur first.



- Related Topics