MCQOPTIONS
Saved Bookmarks
This section includes 11 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. |
Which of the following is not a preprocessor directive? |
| A. | #error |
| B. | #pragma |
| C. | #if |
| D. | #ifelse |
| Answer» E. | |
| 2. |
Which of the following operators is used to concatenate two strings without space? |
| A. | # |
| B. | < > |
| C. | ** |
| D. | ## |
| Answer» E. | |
| 3. |
#pragma GCC poison should be followed by a list of identifiers that are _________ |
| A. | even in number |
| B. | odd in number |
| C. | valid |
| D. | invalid |
| Answer» E. | |
| 4. |
In the directive #pragma pack(n), if the value of 'n' is given to be 5, then what happens? |
| A. | Error |
| B. | Warning but no error |
| C. | Executes the pragma statement |
| D. | Ignores the pragma statement and executes the program |
| Answer» E. | |
| 5. |
The function of __attribute__((packed)); can also be performed using _________ |
| A. | #pragma pack(1); |
| B. | #pragma pack(2); |
| C. | #pragma pack(4); |
| D. | #pragma pack(8); |
| Answer» B. #pragma pack(2); | |
| 6. |
The preprocessor provides the ability for _______________ |
| A. | The inclusion of header files |
| B. | The inclusion of macro expansions |
| C. | Conditional compilation and line control |
| D. | All of the mentioned |
| Answer» E. | |
| 7. |
What is #include directive? |
| A. | Tells the preprocessor to grab the text of a file and place it directly into the current file |
| B. | Statements are not typically placed at the top of a program |
| C. | All of the mentioned |
| D. | None of the mentioned |
| Answer» B. Statements are not typically placed at the top of a program | |
| 8. |
The C-preprocessors are specified with _________symbol. |
| A. | |
| B. | $ |
| C. | ” ” |
| Answer» B. $ | |
| 9. |
1, 1 |
| A. | 1, 2 |
| B. | 2, 1 |
| C. | 2, 2 |
| Answer» C. 2, 2 | |
| 10. |
pragma exit is primarily used for? |
| A. | Checking memory leaks after exiting the program |
| B. | Informing Operating System that program has terminated |
| C. | Running a function at exiting the program |
| D. | No such preprocessor exist |
| Answer» C. Running a function at exiting the program | |
| 11. |
include statement must be written __________ |
| A. | Before main() |
| B. | Before any scanf/printf |
| C. | After main() |
| D. | It can be written anywhere |
| Answer» E. | |