

MCQOPTIONS
Saved Bookmarks
This section includes 175 Mcqs, each offering curated multiple-choice questions to sharpen your C Programming knowledge and support exam preparation. Choose a topic below to get started.
101. |
What is the difference between the following 2 codes?
|
A. | Space does make a difference, values of n1, n2, n3 are different |
B. | No difference as space doesn t make any difference, values of n1, n2, n3 are same in both the case |
C. | Program 2 has syntax error, program 1 is not |
D. | Program 1 has syntax error, program 2 is not |
E. | None of these |
Answer» D. Program 1 has syntax error, program 2 is not | |
102. |
What will be the output of the following C code?
|
A. | Value of q is 19 |
B. | Value of q is 18 |
C. | Value of q is 17 |
D. | Value of q is 5 |
E. | None of these |
Answer» B. Value of q is 18 | |
103. |
What will be the output of the following C code?
|
A. | True 5 |
B. | False 5 |
C. | False 6 |
D. | Compilation Error |
E. | True 6 |
Answer» F. | |
104. |
What will be the output of the following C code?
|
A. | Value of num is 0 |
B. | Value of num is 1 |
C. | Value of num is 2 |
D. | Value of num is 3 |
E. | None of these |
Answer» E. None of these | |
105. |
What will be the output of the following C code?
|
A. | 2 |
B. | 3, 2 |
C. | 2, 3 |
D. | Compilation Error |
E. | None of these |
Answer» C. 2, 3 | |
106. |
What will be the output of the following C code?
|
A. | 2, 2, 2 |
B. | 6, 9, 18 |
C. | 9, 6, 18 |
D. | 18, 6, 9 |
E. | None of these |
Answer» E. None of these | |
107. |
What will be the output of the following C code?
|
A. | Value of num is 7.5 |
B. | Value of num is 3 |
C. | Value of num is 2.0 |
D. | Compilation Error |
E. | None of these |
Answer» E. None of these | |
108. |
What will be the output of the following C code?
|
A. | p is 3 |
B. | Compilation Error |
C. | Runtime Error |
D. | Garbage value |
E. | p is 4 |
Answer» F. | |
109. |
What will be the final value of x in the following C code?
|
A. | 11 |
B. | 36 |
C. | 5 |
D. | 23 |
E. | Depends on compiler |
Answer» C. 5 | |
110. |
What will be the output of the following C code?
|
A. | 15, 15 |
B. | 14, 10 |
C. | 10, 15 |
D. | 10, 14 |
E. | None of these |
Answer» E. None of these | |
111. |
What will be the output of the following C code?
|
A. | -13 |
B. | 3 |
C. | -4 |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
112. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | Runtime Error |
C. | Garbage value |
D. | Yes |
E. | No |
Answer» E. No | |
113. |
Which of the following is the correct output for the program given below?
|
A. | 9 8 8 |
B. | 9 8 7 |
C. | 8 8 7 |
D. | 7 8 8 |
E. | 7 7 8 |
Answer» E. 7 7 8 | |
114. |
Which of the following statements are correct about the code snippet given below?
|
A. | First; is treated as a null statement |
B. | Second; is treated as a statement terminator |
C. | 30 would be assigned to p |
D. | Compiler would report an error |
Answer» E. | |
115. |
Which of the following is the correct output for the program given below ?
|
A. | z = 100 |
B. | z = 200 |
C. | z = 1 |
D. | z = 0 |
E. | z = 300 |
Answer» D. z = 0 | |
116. |
Which of the following is the correct output for the program given below ?
|
A. | c = 0 |
B. | c = 1 |
C. | c = 4 |
D. | c = 2 |
Answer» C. c = 4 | |
117. |
Which of the following is the correct output for the program given below?
int main ( ) { int a = 4, b = -1, c = 0, p, q, r, s; p = a || b || c; q = a && b && c; r = a || b && c; s = a && b || c; printf ("%d %d %d %d n", p, q, r, s); return 0; } |
A. | 1 1 1 1 |
B. | 1 1 0 1 |
C. | 1 0 0 1 |
D. | 0 1 1 1 |
E. | 1 0 1 1 |
Answer» F. | |
118. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | Runtime Error |
C. | Garbage value |
D. | Yes |
E. | No |
Answer» F. | |
119. |
What will be the output of the following C code?
|
A. | 13 |
B. | 3 |
C. | 4 |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
120. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | Runtime Error |
C. | 2 |
D. | 5 |
E. | None of these |
Answer» E. None of these | |
121. |
Which of the following is the correct output for the program given below?
int main ( ) { int a, b, c; a = b = c = 1; c = ++a || ++b && ++c; printf ( "a = %d b = %d c = %d n", a , b, c); return 0; } |
A. | a = 2 b = 1 c = 1 |
B. | a = 2 b = 2 c = 2 |
C. | a = 2 b = 2 c = 1 |
D. | a = 1 b = 2 c = 1 |
Answer» B. a = 2 b = 2 c = 2 | |
122. |
What will be the output of the following C code?
|
A. | 6 |
B. | -6 |
C. | 4 |
D. | -4 |
E. | Compilation Error |
Answer» E. Compilation Error | |
123. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | 5 |
C. | 1 |
D. | Runtime Error |
E. | None of these |
Answer» D. Runtime Error | |
124. |
What will be the output of the following C code?
|
A. | 5 5 4 |
B. | 5 4 5 |
C. | Compilation Error |
D. | 4 5 5 |
E. | None of these |
Answer» E. None of these | |
125. |
What will be the output of the following C code?
|
A. | n1 is 100 |
B. | Compilation Error |
C. | Runtime Error |
D. | Garbage value |
E. | None of these |
Answer» B. Compilation Error | |
126. |
What will be the output of the following C code?
|
A. | -5 |
B. | 2 |
C. | Compilation Error |
D. | -2 |
E. | Either -1 or 1 |
Answer» E. Either -1 or 1 | |
127. |
What will be the output of the following C code?
|
A. | 28 |
B. | 7 |
C. | 2 |
D. | Compilation Error |
E. | None of these |
Answer» B. 7 | |
128. |
What will be the output of the following C code?
|
A. | -7 |
B. | Compilation Error |
C. | -5 |
D. | Runtime Error |
E. | None of these |
Answer» D. Runtime Error | |
129. |
What will be the output of the following C code?
|
A. | 8 -8 3 1 |
B. | 1 3 8 -8 |
C. | 1 8 -8 3 |
D. | 8 1 3 -8 |
E. | None of these |
Answer» B. 1 3 8 -8 | |
130. |
What will be the output of the following C code?
|
A. | 1 |
B. | 6 |
C. | Compilation Error |
D. | Runtime Error |
E. | None of these |
Answer» B. 6 | |
131. |
Comment on the output of the following C code.
|
A. | Bitwise exclusive OR |
B. | Arithmetic Shift right |
C. | Logical Shift left |
D. | No output |
E. | None of these |
Answer» E. None of these | |
132. |
What will be the output of the following C code?
|
A. | 2 |
B. | Compilation Error |
C. | 4 |
D. | Runtime Error |
E. | None of these |
Answer» D. Runtime Error | |
133. |
What will be the output of the following C code?
|
A. | All |
B. | All that glitters is not gold |
C. | that glitters is not gold |
D. | Compilation Error |
E. | None of these |
Answer» D. Compilation Error | |
134. |
What will be the output of the following C code?
|
A. | 3 |
B. | Compilation Error |
C. | 8 |
D. | Runtime Error |
E. | None of these |
Answer» D. Runtime Error | |
135. |
What will be the output of the following C code?
|
A. | -2 |
B. | 2 |
C. | 2 -2 |
D. | -2 2 |
E. | None of these |
Answer» E. None of these | |
136. |
What will be the output of the following C code?
|
A. | -21 |
B. | Compilation Error |
C. | 20 |
D. | Runtime Error |
E. | None of these |
Answer» B. Compilation Error | |
137. |
What will be the output of the following C code?
|
A. | 3 4 4 |
B. | 4 4 3 |
C. | 4 3 3 |
D. | 4 3 4 |
E. | Compilation Error |
Answer» B. 4 4 3 | |
138. |
What will be the output of the following C code?
|
A. | -1 |
B. | 1 |
C. | Compilation Error |
D. | Runtime Error |
E. | None of these |
Answer» B. 1 | |
139. |
What will be the output of the following C code?
|
A. | num1 is 97 |
B. | num1 is 98 |
C. | num1 is 99 |
D. | Compilation Error |
E. | None of these |
Answer» D. Compilation Error | |
140. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | 12 |
C. | Runtime Error |
D. | Address of k |
E. | None of these |
Answer» C. Runtime Error | |
141. |
What will be the output of the following C code?
|
A. | 1 |
B. | 3 |
C. | 3 1 |
D. | 1 3 |
E. | None of these |
Answer» E. None of these | |
142. |
What will be the output of the following C code?
|
A. | 3 |
B. | 4 |
C. | 5 |
D. | Compilation Error |
E. | None of these |
Answer» E. None of these | |
143. |
Which of the following is the correct order of calling functions in the code snippet given below?
|
A. | f1, f2, f3 |
B. | f3, f2, f1 |
C. | The order may vary from compiler to compiler |
D. | None of the above |
Answer» D. None of the above | |
144. |
Which of the following is the correct output for the program given below?
|
A. | 1 15 1 |
B. | 1 20 1 |
C. | 1 25 0 |
D. | 1 1 1 |
E. | 0 0 0 |
Answer» B. 1 20 1 | |
145. |
Which of the following is correct order of evaluation for the expression given below ? |
A. | * / % + - = |
B. | = * / % + - |
C. | / * % - + = |
D. | * / % - + = |
E. | - % / * + = |
Answer» B. = * / % + - | |
146. |
What will be the final values of p and q in the following C statement? (Initial values: p = 2, q = 1) |
A. | p = 1, q = 2; |
B. | p = 2, q = 2; |
C. | p = 2, q = 2; |
D. | p = 0, q = 0; |
E. | None of these |
Answer» E. None of these | |
147. |
What will be the final values of p and q in the following C code? |
A. | k value is 0 and L value is 0 |
B. | k and L value are undefined |
C. | Compilation Error |
D. | Runtime Error |
E. | None of these |
Answer» D. Runtime Error | |
148. |
What will be the final values of k and L in the following C code? |
A. | k value is 0 and L value is 0 |
B. | Compilation Error |
C. | k value is 1 and L value is 1 |
D. | Runtime Error |
E. | None of these |
Answer» B. Compilation Error | |
149. |
What will be the output of the following C function? |
A. | 2 3 |
B. | 2 3 4 |
C. | 2 3 4 5 6 7 |
D. | 5 6 7 |
E. | 5 6 |
Answer» D. 5 6 7 | |
150. |
What will be the final value of c in the following C code snippet? (Initial values: p = 1, q = 2, r = 1) |
A. | r = 2 |
B. | r = 3 |
C. | r = 1 |
D. | Syntax Error |
E. | None of these |
Answer» B. r = 3 | |