

MCQOPTIONS
Saved Bookmarks
This section includes 67 Mcqs, each offering curated multiple-choice questions to sharpen your C Programming knowledge and support exam preparation. Choose a topic below to get started.
1. |
What will be the output of the following C code?
|
A. | Hello how are u? |
B. | Garbage value |
C. | Compilation Error |
D. | Runtime Error |
E. | None of threse |
Answer» D. Runtime Error | |
2. |
What will be the output of the following C code?
|
A. | Hey... |
B. | 0 |
C. | 3 |
D. | Compilation Error |
E. | None of these |
Answer» E. None of these | |
3. |
What will be the output of the following C code?
|
A. | Numbers will be displayed until the signed limit of short and throw a runtime error |
B. | This program will get into an infinite loop and keep printing numbers with no errors |
C. | The control won t fall into the for loop |
D. | Numbers will be displayed until the signed limit of short and program will successfully terminate |
E. | None of these |
Answer» E. None of these | |
4. |
What will be the output of the following C code?
|
A. | Executed After loop |
B. | Compilation Error |
C. | Infinite loop |
D. | Executed In while loop |
E. | None of these |
Answer» C. Infinite loop | |
5. |
What will be the output of the following C code?
|
A. | Executed In for loop |
B. | Depends on the compiler |
C. | Compilation Error |
D. | Depends on the standard compiler implements |
E. | None of these |
Answer» E. None of these | |
6. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | Executed in loop |
C. | Executed After loop |
D. | Infinite loop |
E. | Depends on the value of NULL |
Answer» B. Executed in loop | |
7. |
What will be the output of the following C code?
|
A. | Infinite loop |
B. | Compilation Error |
C. | Executed in loop |
D. | Executed After loop |
E. | None of these |
Answer» E. None of these | |
8. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | "Interview Mania" one time |
C. | "Interview Mania" infinite times |
D. | Runtime Error |
E. | None of these |
Answer» D. Runtime Error | |
9. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | Runtime Error |
C. | "Interview Mania" one time |
D. | Garbage value |
E. | None of these |
Answer» D. Garbage value | |
10. |
How many times k value is checked in the following C code?
|
A. | 3 |
B. | 4 |
C. | 5 |
D. | 6 |
E. | None of these |
Answer» E. None of these | |
11. |
How many times k value is checked in the following C code?
|
A. | 1 |
B. | 2 |
C. | 3 |
D. | 4 |
E. | 5 |
Answer» F. | |
12. |
How many times while loop condition is tested in the following C code snippets, if k is initialized to 0 in both the cases?
|
A. | m+1, m |
B. | m+1, m+1 |
C. | m, m |
D. | m, m+1 |
E. | None of these |
Answer» C. m, m | |
13. |
What will be the output of the following C code?
|
A. | Hello is printed 1 times, Interview Mania 1 times |
B. | Hello is printed 4 times, Interview Mania 4 times |
C. | Hello is printed 1 times, Interview Mania 4 times |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
14. |
What will be the output of the following C code?
|
A. | S |
B. | "Krishana" one time |
C. | "Krishana" infinite times |
D. | Nothing |
E. | None of these |
Answer» D. Nothing | |
15. |
What will be the output of the following C code?
|
A. | "Interview Mania" infinite times |
B. | Compilation Error |
C. | "Interview Mania" one time |
D. | Nothing |
E. | None of these |
Answer» D. Nothing | |
16. |
What will be the output of the following C code?
|
A. | 0, 10 |
B. | 10, 0 |
C. | 11, 10 |
D. | 10, 11 |
E. | None of these |
Answer» E. None of these | |
17. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | "Interview Mania" is printed 6 times |
C. | "Interview Mania" is printed 5 times |
D. | "Interview Mania" is printed 4 times |
E. | None of these |
Answer» C. "Interview Mania" is printed 5 times | |
18. |
What will be the output of the following C code?
|
A. | "Interview Mania" is printed 1 times |
B. | "Interview Mania" is printed 2 times |
C. | "Interview Mania" is printed 3 times |
D. | "Interview Mania" is printed 4 times |
E. | "Interview Mania" is printed 5 times |
Answer» D. "Interview Mania" is printed 4 times | |
19. |
What will be the output of the following C code?
|
A. | 0 |
B. | 9 |
C. | 10 |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
20. |
What will be the output of the following C code?
|
A. | Interview Mania |
B. | Interview |
C. | Mania |
D. | Compilation Error |
E. | None of these |
Answer» B. Interview | |
21. |
What will be the output of the following C code?
|
A. | Hello Interview Mania |
B. | Garbage value |
C. | Compilation Error |
D. | Runtime Error |
E. | None of these |
Answer» D. Runtime Error | |
22. |
What will be the output of the following C code?
|
A. | "Interview Mania" is printed 6 times |
B. | "Interview Mania" is printed 4 times |
C. | Interview Mania |
D. | Compilation Error |
E. | None of these |
Answer» D. Compilation Error | |
23. |
What will be the output of the following C code?
|
A. | Welcome |
B. | To |
C. | Interview Maina |
D. | Welcome To Interview Maina |
E. | Compilation Error |
Answer» E. Compilation Error | |
24. |
What will be the output of the following C code?
|
A. | Hello |
B. | Hey |
C. | Welcome |
D. | Interview Mania |
E. | Hello Interview Mania |
Answer» F. | |
25. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | Mania |
C. | Interview |
D. | Runtime Error |
E. | None of these |
Answer» B. Mania | |
26. |
What will be the output of the following C code?
|
A. | 5 |
B. | Interview Mania |
C. | 5 Interview Mania |
D. | Interview Mania 5 |
E. | None of these |
Answer» D. Interview Mania 5 | |
27. |
What will be the output of the following C code?
|
A. | Nothing |
B. | Compilation Error |
C. | 5 Infinite times |
D. | 5 |
E. | None of these |
Answer» D. 5 | |
28. |
What will be the output of the following C code?
|
A. | HeyHeyHey |
B. | 000 HeyHeyHey |
C. | HeyHeyHey 000 |
D. | 000 |
E. | None of these |
Answer» E. None of these | |
29. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | Interview Mania |
C. | Garbage value |
D. | Runtime Error |
E. | None of these |
Answer» C. Garbage value | |
30. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | Garbage value |
C. | Ajit |
D. | Runtime Error |
E. | None of these |
Answer» B. Garbage value | |
31. |
What will be the output of the following C code?
|
A. | "Interview Mania" is printed one time |
B. | "Interview Mania" is printed 3 time |
C. | "Interview Mania" is printed infinite time |
D. | Compilation Error |
E. | None of these |
Answer» D. Compilation Error | |
32. |
What will be the output of the following C code?
|
A. | Krishna |
B. | Imroj |
C. | Abhay |
D. | Compilation Error |
E. | None of these |
Answer» E. None of these | |
33. |
What will be the output of the following C code?
|
A. | Ajit |
B. | Sumi |
C. | Abhay |
D. | Ajit Sumi Abhay |
E. | Sumi Ajit Abhay |
Answer» E. Sumi Ajit Abhay | |
34. |
What will be the output of the following C code?
|
A. | Ajit |
B. | Imroj |
C. | Imroj Ajit |
D. | Ajit Imroj |
E. | None of these |
Answer» E. None of these | |
35. |
What will be the output of the following C code?
|
A. | "Interveiw Maina" is printed one time |
B. | "Interveiw Maina" is printed infinite time |
C. | Compilation Error |
D. | Garbage value |
E. | None of these |
Answer» D. Garbage value | |
36. |
What will be the output of the following C code?
|
A. | Interview Mania |
B. | "Interview Mania" is printed 4 times |
C. | Compilation Error |
D. | "Interview Mania" is printed infinite times |
E. | None of these |
Answer» E. None of these | |
37. |
What will be the output of the following C code?
|
A. | Mania |
B. | Hello |
C. | Compilation Error |
D. | Runtime Error |
E. | Interview |
Answer» D. Runtime Error | |
38. |
What will be the output of the following C code?
|
A. | 10, 15 |
B. | 15, 10 |
C. | Compilation Error |
D. | Garbage value |
E. | 15, 15 |
Answer» F. | |
39. |
What will be the output of the following C code?
|
A. | Veg... |
B. | Non-Veg... |
C. | Compilation Error |
D. | Runtime Error |
E. | None of these |
Answer» C. Compilation Error | |
40. |
What will be the output of the following C code?
|
A. | Hey... |
B. | Hello... |
C. | Runtime Error |
D. | Compilation Error |
E. | None of these |
Answer» E. None of these | |
41. |
What will be the output of the following C code?
|
A. | Hey... |
B. | Compilation Error |
C. | Nothing |
D. | Runtime Error |
E. | None of these |
Answer» D. Runtime Error | |
42. |
What will be the output of the following C code?
|
A. | 1.000000 |
B. | 2.000000 |
C. | 3.000000 |
D. | 5.000000 |
E. | None of these |
Answer» E. None of these | |
43. |
In the program given below, point out the error, if any, in the while loop.
int main() { int k = 5; while ( ) { printf("%d n", k++); if (k >10) break; } return 0; } |
A. | There should be a condition in the while loop. |
B. | There should be at least a semicolon in the while( ). |
C. | The while loop should be replaced by a for loop. |
D. | No error |
Answer» B. There should be at least a semicolon in the while( ). | |
44. |
Which of then following is the correct output for the program given below?
|
A. | 5 6 7 ........ 127 0 1 2 3 4 |
B. | 5 6 7.........65535 0 1 2 3 4 |
C. | 5 6 ...........32767 -32766 -32765 ...... 3 4 |
D. | No output |
Answer» E. | |
45. |
Which of the following statement are correct about the program given below?
|
A. | The program goes in an infinite loop. |
B. | The program prints all the ASCII values with its corresponding characters. |
C. | Error: ch should be declared as an int. |
D. | The program reports an error as while loop cannot take the form of a for loop. |
Answer» E. | |
46. |
Which of the following is the correct output for the program given below?
|
A. | 0 1 2 3 4 |
B. | 5 |
C. | 1 2 3 4 |
D. | 6 |
Answer» C. 1 2 3 4 | |
47. |
On executing the following program how many times will the message "Thanks God" get printed?
|
A. | Infinite times |
B. | 11 times |
C. | 0 times |
D. | Once |
E. | 10 times |
Answer» D. Once | |
48. |
How many times the while loop in the following program will get executed if a short int is 2 byte wide?
|
A. | Infinite times |
B. | 255 times |
C. | 256 times |
D. | Only once |
E. | 254 times |
Answer» C. 256 times | |
49. |
In the program given below, point out the error, if any, in the for loop.
#include <studio.h> int main() { int i = 1; for (;;) { printf("%d n", i++); if (i > 10) break; } return 0; } |
A. | There should be a condition in the for loop. |
B. | The two semicolons should be dropped. |
C. | The for loop should be replaced by a while loop. |
D. | No error |
Answer» E. | |
50. |
Which of the following is the correct output for the program given below ?
|
A. | 1 2 3 ..... 126 127 -128 - 127 .... -2 -1 |
B. | Expression syntax error |
C. | No Output |
D. | 0 1 2 3 4 5 |
Answer» B. Expression syntax error | |