MCQOPTIONS
Saved Bookmarks
This section includes 6 Mcqs, each offering curated multiple-choice questions to sharpen your C programming (MCQ) questions knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What is stderr? |
| A. | standard error |
| B. | standard error types |
| C. | standard error streams |
| D. | standard error definitions |
| Answer» D. standard error definitions | |
| 2. |
Which directory the compiler first looks for the file when using #include? |
| A. | Current directory where program is saved |
| B. | C:COMPILERINCLUDE |
| C. | S:SOURCEHEADERS |
| D. | Both (b) and (c) simultaneously |
| Answer» C. S:SOURCEHEADERS | |
| 3. |
Comment on the output of this C code?#include #include "test.h"#include "test.h"int main(){//some code} |
| A. | TRUE |
| B. | Compile time error |
| C. | FALSE |
| D. | Depends on the compiler |
| Answer» E. | |
| 4. |
How is search done in #include and #include "somelibrary.h" according to C standard? |
| A. | When former is used, current directory is searched and when latter is used, standard directory is searched |
| B. | When former is used, standard directory is searched and when latter is used, current directory is searched |
| C. | When former is used, search is done in implementation defined manner and when latter is used, current directory is searched |
| D. | For both, search for somelibrary is done in implementation-defined places |
| Answer» E. | |
| 5. |
What would happen if you create a file stdio.h and use #include "stdio.h" ? |
| A. | The predefined library file will be selected |
| B. | The user-defined library file will be selected |
| C. | Both the files will be included |
| D. | The compiler won t accept the program |
| Answer» C. Both the files will be included | |
| 6. |
What will be the output of the program? #includeint main(){int y=128;const int x=y;printf("%d n", x);return 0;} |
| A. | 128 |
| B. | Garbage value |
| C. | Error |
| D. | 0 |
| Answer» B. Garbage value | |