

MCQOPTIONS
Saved Bookmarks
This section includes 15 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. |
Calculate the % of memory saved when bit-fields are used for the following C structure as compared to with-out use of bit-fields for the same structure? (Assuming size of int = 4)
|
A. | 75% |
B. | 50% |
C. | 33.3% |
D. | 25% |
E. | None of these |
Answer» B. 50% | |
2. |
For what minimum value of x in a 32-bit Linux OS would make the size of e equal to 8 bytes?
|
A. | 32 |
B. | 12 |
C. | 8 |
D. | 4 |
E. | None of these |
Answer» C. 8 | |
3. |
What is the order for the following C declarations?
|
A. | Illegal, legal |
B. | Legal, legal |
C. | Legal, illegal |
D. | Illegal, illegal |
E. | None of these |
Answer» E. None of these | |
4. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | Garbage value |
C. | 2 |
D. | Nothing |
E. | Undefined behaviour |
Answer» B. Garbage value | |
5. |
What will be the output of the following C code?
|
A. | 0 |
B. | 1 |
C. | 2 |
D. | Garbage value |
E. | Compilation Error |
Answer» C. 2 | |
6. |
What will be the output of the following C code?
|
A. | 1 |
B. | 2 |
C. | 0 |
D. | Compilation Error |
E. | None of these |
Answer» D. Compilation Error | |
7. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | Garbage value |
C. | 2 |
D. | Nothing |
E. | None of these |
Answer» B. Garbage value | |
8. |
What will be the output of the following C code?
|
A. | Compilation Error |
B. | 0 |
C. | 2 |
D. | Nothing |
E. | None of these |
Answer» D. Nothing | |
9. |
In the following declaration of bit-fields, the constant-expression must be __________.
|
A. | Nonnegative integer value |
B. | Any type |
C. | Nothing |
D. | Integer value |
E. | None of these |
Answer» B. Any type | |
10. |
In the following declaration of bit-fields, the constant-expression specifies __________.
|
A. | Error |
B. | The width of the field in bytes |
C. | Nothing |
D. | The width of the field in bits |
E. | None of these |
Answer» E. None of these | |
11. |
What will be the output of the following C code?
|
A. | 0 |
B. | 1 |
C. | 10 |
D. | 20 |
E. | Garbage value |
Answer» B. 1 | |
12. |
What will be the output of the following C code?
|
A. | 7 |
B. | 2 |
C. | Compilation Error |
D. | Garbage value |
E. | 110 |
Answer» F. | |
13. |
What will be the output of the following C code?
|
A. | 10 |
B. | 13 |
C. | 2 |
D. | Garbage value |
E. | None of these |
Answer» D. Garbage value | |
14. |
What will be the output of the following C code?
|
A. | 2 |
B. | 4 |
C. | Undefined behaviour |
D. | Garbage value |
E. | None of these |
Answer» C. Undefined behaviour | |
15. |
What will be the output of the following C code?
|
A. | Garbage value |
B. | Nothing |
C. | Compilation Error |
D. | 2 |
E. | None of these |
Answer» D. 2 | |