

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.
51. |
What will be the output of the following C code?
|
A. | 30 |
B. | 15 |
C. | 16 |
D. | Compilation Error |
E. | None of these |
Answer» B. 15 | |
52. |
What will be the output of the following C code?
|
A. | 15 |
B. | Compilation Error |
C. | 14 |
D. | Runtime Error |
Answer» F. | |
53. |
While swapping 2 numbers what precautions to be taken care?
|
A. | This code doesn t swap 2 numbers |
B. | All data types are accepted except for (char *) |
C. | Data type should be either of short, int and long |
D. | Data type should be either of float and double |
E. | None of these |
Answer» E. None of these | |
54. |
Which of the following option is the correct representation of the following C statement?
|
A. | t = ((p * q) + (r / (s * u))); |
B. | t = ((p * q) + ((r / s)* u)); |
C. | Both t = ((p * q) + (r / (s * u))); and t = ((p * q) + ((r / s)* u)); |
D. | t = (p * (q +(r /(s * u)))); |
E. | None of these |
Answer» D. t = (p * (q +(r /(s * u)))); | |
55. |
Comment on the following statement.
|
A. | 1, 3 |
B. | 3, 1 |
C. | Depend on compiler |
D. | 3, 1num |
E. | None of these |
Answer» D. 3, 1num | |
56. |
Which operators of the following have same precedence?
|
A. | N, M and S |
B. | N and S |
C. | N and M |
D. | M and S |
E. | None of these |
Answer» E. None of these | |
57. |
What will be the output of the following C code?
|
A. | 74 |
B. | N |
C. | M |
D. | Garbage value |
E. | Compilation Error |
Answer» B. N | |
58. |
What will be the output of the following C code?
|
A. | N |
B. | 0 |
C. | 1 |
D. | Compilation Error |
E. | Garbage value |
Answer» D. Compilation Error | |
59. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | 28 |
C. | 12 |
D. | 13 |
E. | Runtime Error |
Answer» C. 12 | |
60. |
What will be the output of the following C function?
|
A. | 5 4 3 2 1 |
B. | 1 2 3 4 5 |
C. | 4 3 2 1 |
D. | Compilation Error |
E. | Stack overflow |
Answer» F. | |
61. |
What will be the output of the following C code?
|
A. | 12 |
B. | 13 |
C. | 14 |
D. | 15 |
E. | 16 |
Answer» C. 14 | |
62. |
What will be the output of the following C code?
|
A. | -12 |
B. | Compilation Error |
C. | -5 |
D. | Runtime Error |
E. | None of these |
Answer» D. Runtime Error | |
63. |
What will be the output of the following C code?
|
A. | 4 |
B. | 5 |
C. | 6 |
D. | 7 |
E. | 8 |
Answer» F. | |
64. |
What will be the output of the following C code?
|
A. | 15 |
B. | 14 |
C. | 12 |
D. | 811 |
E. | 181 |
Answer» F. | |
65. |
What will be the output of the following C code?
|
A. | 12 |
B. | 14 |
C. | 16 |
D. | 18 |
E. | 20 |
Answer» D. 18 | |
66. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | 4.000000 |
C. | 3.000000 |
D. | 2.000000 |
E. | 1.000000 |
Answer» F. | |
67. |
What will be the output of the following C code?
|
A. | 1.000000 |
B. | 2.000000 |
C. | 3.000000 |
D. | 4.000000 |
E. | 5.000000 |
Answer» B. 2.000000 | |
68. |
What will be the output of the following C code?
|
A. | -3 |
B. | 5 |
C. | 3 |
D. | -5 |
E. | 4 |
Answer» F. | |
69. |
What will be the output of the following C code?
|
A. | Runtime Error |
B. | Undefined behaviour |
C. | Compilation Error |
D. | Wrong |
E. | Right |
Answer» F. | |
70. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | 4 |
C. | 3 |
D. | Runtime Error |
E. | None of these |
Answer» C. 3 | |
71. |
What will be the output of the following C code?
|
A. | 3 |
B. | 4 |
C. | 3.000000 |
D. | 2 |
E. | 2.00000 |
Answer» F. | |
72. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | Garbage value |
C. | Runtime Error |
D. | 14 |
E. | None of these |
Answer» E. None of these | |
73. |
What will be the output of the following C code?
|
A. | 3 |
B. | 4 |
C. | Runtime Error |
D. | Compilation Error |
E. | None of these |
Answer» E. None of these | |
74. |
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 | |
75. |
Which expression has to be present in the following?
|
A. | expression3 |
B. | expression2 |
C. | expression1 |
D. | All of above |
E. | None of these |
Answer» E. None of these | |
76. |
What will be the data type of the following expression? (Initial data type: n = int, num1 = double, num2 = float)
|
A. | float |
B. | double |
C. | int |
D. | All of above |
E. | None of these |
Answer» C. int | |
77. |
What will be the output of the following C code?
|
A. | Runtime Error |
B. | 2 |
C. | 3 |
D. | Compilation Error |
E. | None of these |
Answer» E. None of these | |
78. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | 12 |
C. | Runtime Error |
D. | 10 |
E. | None of these |
Answer» E. None of these | |
79. |
What will be the value of the following assignment expression?
|
A. | 1 |
B. | 0 |
C. | 5 |
D. | 6 |
E. | None of these |
Answer» F. | |
80. |
What is the type of the following assignment expression if p is of type float and q is of type int?
|
A. | float |
B. | double |
C. | int |
D. | there is no type for an assignment expression |
E. | None of these |
Answer» D. there is no type for an assignment expression | |
81. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | 2 |
C. | 1 |
D. | Runtime Error |
E. | None of these |
Answer» B. 2 | |
82. |
What will be the output of the following C code?
|
A. | 1 |
B. | 2 |
C. | 3 |
D. | 4 |
E. | None of these |
Answer» E. None of these | |
83. |
What will be the output of the following C code?
|
A. | 5 |
B. | 4 |
C. | 45 |
D. | Compilation Error |
E. | None of these |
Answer» D. Compilation Error | |
84. |
What will be the output of the following C code snippet?
|
A. | -10 |
B. | Compilation Error |
C. | Runtime Error |
D. | Garbage value |
E. | None of these |
Answer» B. Compilation Error | |
85. |
What will be the output of the following C code snippet?
|
A. | 2 |
B. | Runtime Error |
C. | 3 |
D. | Compilation Error |
E. | None of these |
Answer» E. None of these | |
86. |
What will be the output of the following C code?
|
A. | 10 |
B. | Compilation Error |
C. | p |
D. | Runtime Error |
E. | None of these |
Answer» C. p | |
87. |
What will be the output of the following C code?
|
A. | 0 |
B. | 2 |
C. | 6 |
D. | 7 |
E. | None of these |
Answer» D. 7 | |
88. |
What will be the output of the following C code?
|
A. | 2 |
B. | 7 |
C. | 6 |
D. | Compilation Error |
E. | None of these |
Answer» C. 6 | |
89. |
What will be the output of the following C code?
|
A. | 20 |
B. | 10 |
C. | Compilation Error |
D. | 1 |
E. | None of these |
Answer» E. None of these | |
90. |
What will be the output of the following C code?
|
A. | 12 |
B. | 2 |
C. | 3 |
D. | 0 12 |
E. | 12 0 |
Answer» E. 12 0 | |
91. |
What will be the output of the following C code?
|
A. | 4 |
B. | 6 |
C. | 12 |
D. | 6 1 |
E. | 1 6 |
Answer» E. 1 6 | |
92. |
What will be the final value of n4 in the following C code?
|
A. | 8 |
B. | 4 |
C. | 1 |
D. | 0 |
E. | None of these |
Answer» D. 0 | |
93. |
What will be the output of the following C code?
|
A. | TRUE 2 |
B. | TRUE 1 |
C. | Compilation Error |
D. | Runtime Error |
E. | None of these |
Answer» B. TRUE 1 | |
94. |
What will be the output of the following C code?
|
A. | 16 |
B. | 3.26 |
C. | 19 |
D. | Compilation Error |
E. | None of these |
Answer» D. Compilation Error | |
95. |
What will be the output of the following C code?
|
A. | No |
B. | Compilation Error |
C. | 3 |
D. | Yes |
E. | None of these |
Answer» E. None of these | |
96. |
What will be the final value of L in the following C code?
|
A. | 0 |
B. | Nothing |
C. | 12 |
D. | Compilation Error |
E. | None of these |
Answer» B. Nothing | |
97. |
What will be the final value of L in the following C code?
|
A. | Nothing |
B. | 0 |
C. | Depends on language standard |
D. | Depends on the compiler |
E. | None of these |
Answer» C. Depends on language standard | |
98. |
What will be the output of the following C code?
|
A. | 1 |
B. | 2 |
C. | 3 |
D. | 4 |
E. | 5 |
Answer» F. | |
99. |
What will be the output of the following C code?
|
A. | 5 |
B. | 7 |
C. | Compilation Error |
D. | Runtime Error |
E. | None of these |
Answer» D. Runtime Error | |
100. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | It's zero |
C. | Runtime Error |
D. | It's not zero |
E. | None of these |
Answer» E. None of these | |