

MCQOPTIONS
Saved Bookmarks
This section includes 91 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. | 111 |
B. | 222 |
C. | Compilation Error |
D. | Garbage value |
E. | None of these |
Answer» B. 222 | |
52. |
What will be the output of the following C code?
|
A. | 25 |
B. | Compilation Error |
C. | Garbage value |
D. | 15 |
E. | None of these |
Answer» E. None of these | |
53. |
Can the following C code be compiled successfully?
|
A. | Depends on the standard |
B. | No |
C. | Depends on the platform |
D. | Yes |
E. | None of these |
Answer» E. None of these | |
54. |
What will be the output of the following C code?
|
A. | Garbage value |
B. | Nothing |
C. | Compilation Error |
D. | 1001 |
E. | None of these |
Answer» D. 1001 | |
55. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | Garbage value |
C. | 40 |
D. | Undefined behaviour |
E. | None of these |
Answer» D. Undefined behaviour | |
56. |
What will be the output of the following C code?
|
A. | Jockey |
B. | 39 |
C. | Compilation Error |
D. | Garbage value |
E. | None of these |
Answer» D. Garbage value | |
57. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | Nothing |
C. | England |
D. | 15 |
E. | None of these |
Answer» B. Nothing | |
58. |
What will be the output of the following C code?
|
A. | 50 |
B. | 55 |
C. | Compilation Error |
D. | Garbage value |
E. | None of these |
Answer» D. Garbage value | |
59. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | Garbage value |
C. | 101 |
D. | 202 |
E. | None of these |
Answer» D. 202 | |
60. |
What will be the output of the following C code?
|
A. | 15 |
B. | 25 |
C. | 35 |
D. | 45 |
E. | None of these |
Answer» B. 25 | |
61. |
What will be the output of the following C code?
|
A. | 13 |
B. | 23 |
C. | 33 |
D. | 43 |
E. | None of these |
Answer» D. 43 | |
62. |
What will be the output of the following C code?
|
A. | 0 |
B. | 2 |
C. | 4 |
D. | 8 |
E. | None of these |
Answer» B. 2 | |
63. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | Garbage value |
C. | Ajit Kumar Gupta |
D. | Undefined behaviour |
E. | None of these |
Answer» B. Garbage value | |
64. |
What will be the output of the following C code?
|
A. | Imaraj |
B. | Compilation Error |
C. | Garbage value |
D. | Nothing |
E. | None of these |
Answer» C. Garbage value | |
65. |
What will be the output of the following C code?
|
A. | False |
B. | Compilation Error |
C. | Garbage value |
D. | Nothing |
E. | None of these |
Answer» B. Compilation Error | |
66. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | Garbage value |
C. | Interview Mania |
D. | Nothing |
E. | None of these |
Answer» D. Nothing | |
67. |
What will be the output of the following C code?
|
A. | 16 |
B. | 8 |
C. | 4 |
D. | 2 |
E. | None of these |
Answer» B. 8 | |
68. |
What is the output of this C code?
|
A. | Ajit Ajit |
B. | Garbage value |
C. | Compilation Error |
D. | Nothing |
E. | None of these |
Answer» B. Garbage value | |
69. |
What will be the output of the following C code according to C99 standard?
|
A. | 333.000000 |
B. | Compilation Error |
C. | Garbage value |
D. | 0.000000 |
E. | None of these |
Answer» E. None of these | |
70. |
What will be the output of the following C code according to C99 standard?
|
A. | 31.000000 |
B. | Compilation Error |
C. | Garbage value |
D. | Undefined behabiour |
E. | 0.000000 |
Answer» F. | |
71. |
What will be the output of the following C code according to C99 standard?
|
A. | Compilation Error |
B. | 13.000000 |
C. | Garbage value |
D. | Undefined behaviour |
E. | None of these |
Answer» C. Garbage value | |
72. |
Which of the following structure declaration is incorrect ? |
A. | <pre class="prettyprint lang-c">struct aa<br>{<br> int a;<br> float b;<br>};<br></pre> |
B. | <pre class="prettyprint lang-c">struct aa<br>{<br> int a;<br> float b;<br> struct aa var;<br>};<br></pre> |
C. | <pre class="prettyprint lang-c">struct aa<br>{<br> int a;<br> float b;<br> struct aa *var;<br>};<br></pre> |
D. | <pre class="prettyprint lang-c">struct aa<br>{<br> int a;<br> float b;<br> struct aa **var;<br>};<br></pre> |
Answer» C. <pre class="prettyprint lang-c">struct aa<br>{<br> int a;<br> float b;<br> struct aa *var;<br>};<br></pre> | |
73. |
Which of the following is the correct output fot the program given below? |
A. | 0 0.000000 |
B. | Garbage values |
C. | Error |
D. | None of the above |
Answer» B. Garbage values | |
74. |
Which of the following structure declaration is correct ? |
A. | <pre class="prettyprint lang-c">struct employ<br>{<br> char name[10];<br> float salary;<br> int workingdays;<br>};<br></pre> |
B. | <pre class="prettyprint lang-c">struct employ<br>{<br> char name[10];<br> float salary;<br> int workingdays;<br>}<br></pre> |
C. | <pre class="prettyprint lang-c">struct employ<br>{<br> char name[10]<br> float salary<br> int workingdays<br>};<br></pre> |
D. | All of the above. |
Answer» B. <pre class="prettyprint lang-c">struct employ<br>{<br> char name[10];<br> float salary;<br> int workingdays;<br>}<br></pre> | |
75. |
Which of the following will stop the loop at the last node of a linked list in the following C code snippet? |
A. | <pre class="prettyprint lang-c">while (p->next != NULL)<br> {<br> p = p->next;<br> }<br></pre> |
B. | <pre class="prettyprint lang-c">while (1)<br> {<br> p = p->next;<br> if (p == NULL)<br> break;<br> }<br></pre> |
C. | <pre class="prettyprint lang-c">while (p != NULL)<br> {<br> p = p->next;<br> }<br></pre> |
D. | All of above |
E. | None of these |
Answer» B. <pre class="prettyprint lang-c">while (1)<br> {<br> p = p->next;<br> if (p == NULL)<br> break;<br> }<br></pre> | |
76. |
Presence of code like s.t.b = 100 indicates __________. |
A. | double data type |
B. | Syntax Error |
C. | Structure |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
77. |
Presence of loop in a linked list can be tested by ________. |
A. | Comparing the address of nodes by address of every other node |
B. | Comparing the the value stored in a node by a value in every other node |
C. | Traveling the list, if NULL is encountered no loop exists |
D. | All of above |
E. | None of these |
Answer» B. Comparing the the value stored in a node by a value in every other node | |
78. |
What will be the output of the following C code according to C99 standard? |
A. | Compilation Error |
B. | 13.000000 |
C. | Garbage value |
D. | Undefined behaviour |
E. | None of these |
Answer» C. Garbage value | |
79. |
The number of distinct nodes the following struct declaration can point to is _____________. |
A. | 3 |
B. | 2 |
C. | 1 |
D. | All of above |
E. | None of these |
Answer» E. None of these | |
80. |
How many bytes in memory taken by the following C structure? |
A. | Multiple of word size |
B. | Depends on the platform |
C. | integer size+character size |
D. | Multiple of integer size |
E. | None of these |
Answer» E. None of these | |
81. |
Which option is not possible for the following function call? |
A. | Individual member can be passed by reference in a function |
B. | Individual member s address can be displayed in structure |
C. | Compiler can access entire structure from the function |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
82. |
Can the following C code be compiled successfully? |
A. | Depends on the standard |
B. | No |
C. | Depends on the platform |
D. | Yes |
E. | None of these |
Answer» E. None of these | |
83. |
Which of the following structure declaration doesn t require pass-by-reference? |
A. | <pre class="prettyprint lang-c">struct temp{int a;};<br> main(){}<br> struct temp s;<br></pre> |
B. | <pre class="prettyprint lang-c">struct{int a;}s;<br> main(){}<br></pre> |
C. | <pre class="prettyprint lang-c">struct temp{int a;};<br> main(){<br> struct temp s;<br> }<br></pre> |
D. | All of above |
E. | None of these |
Answer» F. | |
84. |
Which of the following is an incorrect syntax to pass by reference a member of a structure in a function? |
A. | func(&(e).num); |
B. | func(&(e.num)); |
C. | func(&e.num); |
D. | All of above |
E. | None of these |
Answer» F. | |
85. |
The correct syntax to access the member of the ith structure in the array of structures is? |
A. | sct[j].n; |
B. | sct.n[j]; |
C. | sct.[j].n; |
D. | sct.n.[j]; |
E. | None of these |
Answer» B. sct.n[j]; | |
86. |
Which of the following is an incorrect syntax for pointer to structure? |
A. | (*ptr_struct).n = 110; |
B. | ptr_struct->n = 110; |
C. | *ptr_struct.n = 110; |
D. | Both (*ptr_struct).n = 110; and *ptr_struct.n = 110; |
E. | None of these |
Answer» D. Both (*ptr_struct).n = 110; and *ptr_struct.n = 110; | |
87. |
What will be the output of the following C code? (Assuming size of int be 4) |
A. | 16 |
B. | 12 |
C. | 4 |
D. | Compilation Error |
E. | None of these |
Answer» C. 4 | |
88. |
What is the correct syntax to declare a function fun() which receives an array of structure in function? |
A. | void fun(struct *num[]); |
B. | void fun(struct num); |
C. | void fun(struct *num); |
D. | All of above |
E. | None of these |
Answer» D. All of above | |
89. |
Comment on the output of the following C code. |
A. | No Compile time error, generates an array of structure of size 9 |
B. | Compile time error, illegal declaration of a multidimensional array |
C. | Compile time error, illegal assignment to members of structure |
D. | No Compile time error, generates an array of structure of size 3 |
E. | None of these |
Answer» E. None of these | |
90. |
Which of the following structure declaration will throw an error? |
A. | <pre class="prettyprint lang-c">struct temp{};<br> struct temp s;<br> main(){}<br></pre> |
B. | <pre class="prettyprint lang-c">struct temp s;<br> struct temp{};<br> main(){}<br></pre> |
C. | <pre class="prettyprint lang-c">struct temp{}s;<br> main(){}<br></pre> |
D. | All of above |
E. | None of these |
Answer» F. | |
91. |
User-defined data type can be derived by___________. |
A. | enum |
B. | typedef |
C. | struct |
D. | All of above |
E. | None of these |
Answer» E. None of these | |