

MCQOPTIONS
This section includes 564 Mcqs, each offering curated multiple-choice questions to sharpen your Engineering knowledge and support exam preparation. Choose a topic below to get started.
101. |
What will be the output of the program in Turbo C?
|
A. | 4, 4, 8 |
B. | 4, 4, 4 |
C. | 2, 4, 8 |
D. | 2, 4, 4 |
Answer» E. | |
102. |
What will be the output of the program?
|
A. | 4, 4, 4 |
B. | 2, 4, 4 |
C. | 4, 4, 2 |
D. | 2, 4, 8 |
Answer» B. 2, 4, 4 | |
103. |
What will be the output of the program?
|
A. | 4343445454, 4343445454 |
B. | 4545455434, 4545455434 |
C. | 4294967295, 4294967295 |
D. | Garbage values |
Answer» D. Garbage values | |
104. |
What will be the output of the program in DOS (Compiler - Turbo C)?
|
A. | 4 |
B. | 8 |
C. | 16 |
D. | 22 |
Answer» C. 16 | |
105. |
What will be the output of the program?
|
A. | 72, 68.000000 |
B. | 72.000000, 68 |
C. | 68.000000, 72.000000 |
D. | 68, 72.000000 |
Answer» B. 72.000000, 68 | |
106. |
What will be the output of the program?
|
A. | Nagpur, Chennai, Bangalore |
B. | agpur, hennai, angalore |
C. | agpur, Chennai, angalore |
D. | agpur, Bangalore, Bangalore |
Answer» E. | |
107. |
What will be the output of the program?
|
A. | 9 |
B. | 0 |
C. | 90.000000 |
D. | 90 |
Answer» D. 90 | |
108. |
What will be the output of the program?
|
A. | 1314 |
B. | Garbage value |
C. | 1316 |
D. | Random address |
Answer» B. Garbage value | |
109. |
What will be the output of the program?
|
A. | 0 |
B. | 1 |
C. | 2 |
D. | Error |
Answer» C. 2 | |
110. |
Point out the correct statement will let you access the elements of the array using 'p' in the following program?
|
A. | <pre><code class="cpp">for(i=0; i<3; i++) { for(j=0; j<3; j++) printf("%d", p[i+j]); } </code></pre> |
B. | <pre><code class="cpp">for(i=0; i<3; i++) printf("%d", p[i]); </code></pre> |
C. | <pre><code class="cpp">for(i=0; i<3; i++) { for(j=0; j<3; j++) printf("%d", p[i][j]); } </code></pre> |
D. | <pre><code class="cpp">for(j=0; j<3; j++) printf("%d", p[i][j]); </code></pre> |
Answer» D. <pre><code class="cpp">for(j=0; j<3; j++) printf("%d", p[i][j]); </code></pre> | |
111. |
Which of the following statement is correct prototype of the malloc() function in c ? |
A. | int* malloc(int); |
B. | char* malloc(char); |
C. | unsigned int* malloc(unsigned int); |
D. | void* malloc(size_t); |
Answer» E. | |
112. |
Point out the error in the following program.
|
A. | Error: unable to allocate memory |
B. | Error: We cannot store address of allocated memory in |
C. | <i class="C-code">a</i> |
D. | Error: unable to free memory |
E. | No error |
Answer» C. <i class="C-code">a</i> | |
113. |
Point out the correct statement which correctly free the memory pointed to by 's' and 'p' in the following program?
|
A. | free(p); , free(p->s); |
B. | free(p->s); , free(p); |
C. | free(p->s); |
D. | free(p); |
Answer» C. free(p->s); | |
114. |
What will be the output of the program (16-bit platform)?
|
A. | 4 |
B. | 2 |
C. | 8 |
D. | Garbage value |
Answer» C. 8 | |
115. |
What will be the output of the program?
|
A. | 0xffff |
B. | Garbage value |
C. | 0xffee |
D. | Error |
Answer» C. 0xffee | |
116. |
Is the following declaration correct? |
A. | Yes |
B. | No |
Answer» C. | |
117. |
Is the following declaration correct? |
A. | Yes |
B. | No |
Answer» B. No | |
118. |
It is necessary to call the macro va_end if va_start is called in the function. |
A. | Yes |
B. | No |
Answer» B. No | |
119. |
Is the following declaration correct? |
A. | Yes |
B. | No |
Answer» B. No | |
120. |
Is the following declaration correct? |
A. | Yes |
B. | No |
Answer» B. No | |
121. |
Are the following declarations same?
|
A. | Yes |
B. | No |
Answer» C. | |
122. |
The macro va_arg is used to extract an argument from the fixed micro argument list and advance the pointer to the next argument. |
A. | Yes |
B. | No |
Answer» C. | |
123. |
Does the data type of all elements in the union will be same. |
A. | True |
B. | False |
Answer» C. | |
124. |
It is not necessary to typecast the address returned by malloc(). |
A. | True |
B. | False |
Answer» C. | |
125. |
We can modify the pointers "source" as well as "target". |
A. | True |
B. | False |
Answer» B. False | |
126. |
va_list is an array that holds information needed by va_arg and va_end |
A. | True |
B. | False |
Answer» B. False | |
127. |
The macro va_start is used to initialise a pointer to the beginning of the list of fixed arguments. |
A. | True |
B. | False |
Answer» C. | |
128. |
Point out the error in the following program.
|
A. | Error: too many parameters |
B. | Error: invalid access to list member |
C. | Error: ptr must be type of |
D. | <i class="C-code">va_list</i> |
E. | No error |
Answer» D. <i class="C-code">va_list</i> | |
129. |
What will be the output of the program?
|
A. | 4, 4, 8 |
B. | 4, 4, 4 |
C. | 2, 4, 4 |
D. | 2, 4, 8 |
Answer» D. 2, 4, 8 | |
130. |
What will be the output of the program?
|
A. | 4, 4, 4 |
B. | 2, 2, 2 |
C. | 2, 8, 4 |
D. | 2, 4, 8 |
Answer» B. 2, 2, 2 | |
131. |
What will be the output of the program (in Turbo C under DOS)?
|
A. | 4, 4, 8 |
B. | 2, 4, 4 |
C. | 4, 4, 2 |
D. | 2, 4, 8 |
Answer» D. 2, 4, 8 | |
132. |
What will be the output of the program?
|
A. | 2, 8 |
B. | 4, 8 |
C. | 2, 4 |
D. | 4, 12 |
Answer» E. | |
133. |
What will be the output of the program in DOS (Compiler - Turbo C)?
|
A. | 1 |
B. | 2 |
C. | 4 |
D. | 8 |
Answer» C. 4 | |
134. |
What will be the output of the program, if a short int is 2 bytes wide?
|
A. | 1 ... 65535 |
B. | Expression syntax error |
C. | No output |
D. | 0, 1, 2, 3, 4, 5 |
Answer» B. Expression syntax error | |
135. |
What will be the output of the program?
|
A. | Hi |
B. | Hello |
C. | Hi Hello |
D. | None of above |
Answer» B. Hello | |
136. |
Can we pass a variable argument list to a function at run-time? |
A. | Yes |
B. | No |
Answer» C. | |
137. |
Which of the following statements are correct about an if-else statements in a C-program?
|
||||||||
A. | 1 and 2 | ||||||||
B. | 2 and 3 | ||||||||
C. | 1, 2 and 4 | ||||||||
D. | 2, 3, 4 | ||||||||
Answer» E. | |||||||||
138. |
Can we use a switch statement to switch on strings? |
A. | Yes |
B. | No |
Answer» C. | |
139. |
Is it true that too many recursive calls may result into stack overflow? |
A. | Yes |
B. | No |
Answer» B. No | |
140. |
A macro must always be defined in capital letters. |
A. | True |
B. | False |
Answer» C. | |
141. |
The modulus operator cannot be used with a long double. |
A. | True |
B. | False |
Answer» B. False | |
142. |
While defining a variable argument list function we drop the ellipsis(...)? |
A. | Yes |
B. | No |
Answer» B. No | |
143. |
Is it necessary that in a function which accepts variable argument list there should be at least be one fixed argument? |
A. | Yes |
B. | No |
Answer» B. No | |
144. |
Can we write a function that takes a variable argument list and passes the list to another function? |
A. | Yes |
B. | No |
Answer» B. No | |
145. |
The macro va_arg is used to extract an argument from the variable argument list and advance the pointer to the next argument. |
A. | True |
B. | False |
Answer» B. False | |
146. |
Point out the error if any in the following program (Turbo C).
|
A. | Error: unknown variable ptr |
B. | Error: Lvalue required for parameter |
C. | No error and print A a b c |
D. | No error and print 4 A a b c |
Answer» D. No error and print 4 A a b c | |
147. |
Point out the error in the following program.
|
A. | Error: ptr has to be set at begining |
B. | Error: ptr must be type of |
C. | <i class="C-code">va_list</i> |
D. | Error: invalid access to list member |
E. | No error |
Answer» B. Error: ptr must be type of | |
148. |
Can the fixed arguments passed to the function that accepts variable argument list, occur at the end? |
A. | Yes |
B. | No |
Answer» C. | |
149. |
A function that receives variable number of arguments should use va_arg() to extract arguments from the variable argument list. |
A. | True |
B. | False |
Answer» B. False | |
150. |
For a function receives variable number of arguments it is necessary that the function should receive at least one fixed argument. |
A. | True |
B. | False |
Answer» B. False | |