

MCQOPTIONS
Saved Bookmarks
This section includes 204 Mcqs, each offering curated multiple-choice questions to sharpen your C Programming knowledge and support exam preparation. Choose a topic below to get started.
151. |
The value obtained in the function is given back to main by using ________ keyword. |
A. | return |
B. | static |
C. | new |
D. | volatile |
Answer» B. static | |
152. |
Which of the following file extensions are accepted with #include? |
A. | .h |
B. | .in |
C. | .com |
D. | All of the mentioned |
Answer» E. | |
153. |
The #elif directive cannot appear after the preprocessor #else directive. |
A. | True |
B. | False |
C. | None of the mentioned |
D. | Varies |
Answer» B. False | |
154. |
What is a preprocessor? |
A. | That processes its input data to produce output that is used as input to another program |
B. | That is nothing but a loader |
C. | That links various source files |
D. | All of the mentioned |
Answer» B. That is nothing but a loader | |
155. |
#include statement must be written __________ |
A. | Before main() |
B. | Before any scanf/printf |
C. | After main() |
D. | It can be written anywhere |
Answer» C. After main() | |
156. |
If storage class is not specified for a local variable, then the default class will be auto. |
A. | True |
B. | False |
C. | Depends on the standard |
D. | None of the mentioned |
Answer» B. False | |
157. |
If the file name is enclosed in double quotation marks, then _________ |
A. | The preprocessor treats it as a user-defined file |
B. | The preprocessor treats it as a system-defined file |
C. | The preprocessor treats it as a user-defined file & system-defined file |
D. | None of the mentioned |
Answer» B. The preprocessor treats it as a system-defined file | |
158. |
If the file name is enclosed in angle brackets, then ___________ |
A. | The preprocessor treats it as a user-defined file |
B. | The preprocessor treats it as a system-defined file |
C. | The preprocessor treats it as a user-defined file & system-defined file |
D. | None of the mentioned |
Answer» C. The preprocessor treats it as a user-defined file & system-defined file | |
159. |
In a conditional inclusion, if the condition that comes after the if is true, then what will happen during compilation? |
A. | Then the code up to the following #else or #elif or #endif is compiled |
B. | Then the code up to the following #endif is compiled even if #else or #elif is present |
C. | Then the code up to the following #eliif is compiled |
D. | None of the mentioned |
Answer» B. Then the code up to the following #endif is compiled even if #else or #elif is present | |
160. |
For each #if, #ifdef, and #ifndef directive. |
A. | There are zero or more #elif directives |
B. | Zero or one #else directive |
C. | One matching #endif directive |
D. | All of the mentioned |
Answer» E. | |
161. |
What will be the output of the program?
#include
|
A. | Infinite loop |
B. | Hi |
C. | Hello Hi |
D. | Error |
Answer» D. Error | |
162. |
What will be the output of the program?
#include
|
A. | 12, 12 |
B. | 7, 7 |
C. | 7, 12 |
D. | 12, 7 |
Answer» B. 7, 7 | |
163. |
What will be the output of the program?
#include
|
A. | 6 |
B. | 1 |
C. | 0 |
D. | -1 |
Answer» C. 0 | |
164. |
What will be the output of the program?
#include
|
A. | 3, 4, 4, 3 |
B. | 4, 3, 4, 3 |
C. | 3, 3, 4, 4 |
D. | 3, 4, 3, 4 |
Answer» C. 3, 3, 4, 4 | |
165. |
Is it true that too many recursive calls may result into stack overflow? |
A. | Yes |
B. | No |
Answer» B. No | |
166. |
What will be the output of the program?
#include
|
A. | 9 |
B. | 10 |
C. | 11 |
D. | 8 |
Answer» B. 10 | |
167. |
If int is 2 bytes wide.What will be the output of the program?
#include
|
A. | ab |
B. | cd |
C. | ef |
D. | gh |
Answer» C. ef | |
168. |
What will be the output of the program?
#include
|
A. | 5 |
B. | 3 |
C. | Garbage value |
D. | 4 |
Answer» B. 3 | |
169. |
What will be the output of the program?
#include
|
A. | 12 12 |
B. | No error, No output |
C. | Error: Compile error |
D. | None of above |
Answer» B. No error, No output | |
170. |
What will be the output of the program?
#include
|
A. | k=35 |
B. | k=36 |
C. | k=37 |
D. | k=38 |
Answer» E. | |
171. |
In a function two return statements should never occur. |
A. | Yes |
B. | No |
Answer» C. | |
172. |
What will be the output of the program?
#include
|
A. | 5 |
B. | 4 |
C. | Error |
D. | Garbage value |
Answer» B. 4 | |
173. |
What will be the output of the program?
#include
|
A. | AB |
B. | BC |
C. | CD |
D. | No output |
Answer» C. CD | |
174. |
Names of functions in two different files linked together must be unique |
A. | 1 |
B. | |
Answer» B. | |
175. |
What will be the output of the program?
#include
|
A. | Print 10 |
B. | Print 20 |
C. | Print 1 |
D. | Compile error |
Answer» E. | |
176. |
What will be the output of the program?
#include
|
A. | 100 |
B. | 10 |
C. | 1 |
D. | 0 |
Answer» B. 10 | |
177. |
Maximum number of arguments that a function can take is 12 |
A. | Yes |
B. | No |
Answer» C. | |
178. |
What will be the output of the program?
#include
|
A. | 5, 2 |
B. | 10, 4 |
C. | 2, 5 |
D. | 25, 4 |
Answer» E. | |
179. |
Will the following functions work? int f1(int a, int b) { return ( f2(20) ); } int f2(int a) { return (a*a); } |
A. | Yes |
B. | No |
Answer» B. No | |
180. |
Functions cannot return more than one value at a time |
A. | 1 |
B. | |
Answer» B. | |
181. |
A function may have any number of return statements each returning different values. |
A. | 1 |
B. | |
C. | 1 |
D. | |
Answer» B. | |
182. |
What will be the output of the program?
#include
|
A. | prints "IndiaBIX, C-Program" infinitely |
B. | prints "C-Program" infinetly |
C. | prints "C-Program, IndiaBIX" infinitely |
D. | Error: main() should not inside else statement |
Answer» C. prints "C-Program, IndiaBIX" infinitely | |
183. |
Usually recursion works slower than loops. |
A. | Yes |
B. | No |
C. | Yes |
D. | No |
Answer» B. No | |
184. |
Every function must return a value |
A. | Yes |
B. | No |
Answer» C. | |
185. |
Point out the error in the program
#include
|
A. | Error: Prototype declaration |
B. | No error |
C. | Error: return statement cannot be used with conditional operators |
D. | None of above |
Answer» D. None of above | |
186. |
If a function contains two return statements successively, the compiler will generate warnings. Yes/No ? |
A. | Yes |
B. | No |
Answer» B. No | |
187. |
Functions can be called either by value or reference |
A. | 1 |
B. | |
Answer» B. | |
188. |
What will be the output of the program?
#include
|
A. | 4, 4 |
B. | 3, 3 |
C. | 6, 6 |
D. | 12, 12 |
Answer» D. 12, 12 | |
189. |
Which of the following statements are correct about the function? long fun(int num) { int i; long f=1; for(i=1; i<=num; i++) f = f * i; return f; } |
A. | The function calculates the value of 1 raised to power num. |
B. | The function calculates the square root of an integer |
C. | The function calculates the factorial value of an integer |
D. | None of above |
Answer» D. None of above | |
190. |
If return type for a function is not specified, it defaults to int |
A. | 1 |
B. | |
Answer» B. | |
191. |
Point out the error in the program
#include
|
A. | Error: Not allowed assignment |
B. | Error: Doesn't print anything |
C. | No error |
D. | None of above |
Answer» B. Error: Doesn't print anything | |
192. |
What will be the output of the program?
#include
|
A. | Print 5, 4, 3, 2, 1 |
B. | Print 1, 2, 3, 4, 5 |
C. | Print 5, 4, 3, 2, 1, 0 |
D. | Infinite loop |
Answer» E. | |
193. |
What will be the output of the program?
#include
|
A. | Prints "IndiaBIX" 5 times |
B. | Function main() doesn't calls itself |
C. | Infinite loop |
D. | Prints "IndiaBIx" |
Answer» E. | |
194. |
What will be the output of the program?
#include
|
A. | Hello |
B. | Hi Hello |
C. | No output |
D. | Infinite loop |
Answer» B. Hi Hello | |
195. |
There is a error in the below program. Which statement will you add to remove it?
#include
|
A. | Add prototype: float f(aa, bb) |
B. | Add prototype: float f(int, float) |
C. | Add prototype: float f(float, int) |
D. | Add prototype: float f(bb, aa) |
Answer» C. Add prototype: float f(float, int) | |
196. |
What will be the output of the program?
#include
|
A. | 0, 2, 1, 0, |
B. | 1, 1, 2, 0, |
C. | 0, 1, 0, 2, |
D. | 0, 1, 2, 0, |
Answer» E. | |
197. |
In C all functions except main() can be called recursively. |
A. | 1 |
B. | |
Answer» C. | |
198. |
How many times the program will print "IndiaBIX" ?
#include
|
A. | Infinite times |
B. | 32767 times |
C. | 65535 times |
D. | Till stack overflows |
Answer» E. | |
199. |
Point out the error in the program f(int a, int b) { int a; a = 20; return a; } |
A. | Missing parenthesis in return statement |
B. | The function should be defined as int f(int a, int b) |
C. | Redeclaration of a |
D. | None of above |
Answer» D. None of above | |
200. |
A function cannot be defined inside another function |
A. | 1 |
B. | |
C. | 1 |
D. | |
Answer» B. | |