This set of C Multiple Choice Questions & Answers (MCQs) focuses on “C-Preprocessor – 1”.
Pre-requisite for this C MCQ set: Advanced C Programming Video Tutorial.
1. Property which allows to produce different executable for different platforms in C is called?
a) File inclusion
b) Selective inclusion
c) Conditional compilation
d) Recursive macros
Explanation: Conditional compilation is the preprocessor facility to produce a different executable.
2. What is #include <stdio.h>?
a) Preprocessor directive
b) Inclusion directive
c) File inclusion directive
d) None of the mentioned
3. C preprocessors can have compiler specific features.
c) Depends on the standard
d) Depends on the platform
Explanation: #pragma is compiler specific feature.
4. What will be the output of the following C code?
#define foo(m, n) m * n = 10
a) In main
b) Compilation error as lvalue is required for the expression m*n=10
c) Preprocessor error as lvalue is required for the expression m*n=10
d) None of the mentioned
Explanation: Preprocessor just replaces whatever is given compiler then checks for error at the replaced part of the code. Here it is not replaced anywhere.
$ cc pgm1.c
5. C preprocessor is conceptually the first step during compilation.
c) Depends on the compiler
d) Depends on the standard
6. Preprocessor feature that supply line numbers and filenames to compiler is called?
a) Selective inclusion
b) macro substitution
d) Line control
7. #include <somefile.h> are _______ files and #include “somefile.h” ________ files.
a) Library, Library
b) Library, user-created header
c) User-created header, library
d) They can include all types of file
Explanation: Both of these statement can be used to select any file.
8. What is a preprocessor?
a) That processes its input data to produce output that is used as input to another program
b) That is nothing but a loader
c) That links various source files
d) All of the mentioned
Explanation: A preprocessor is a program that processes its input data to produce output that is used as input to another program.
Sanfoundry Global Education & Learning Series – C Programming Language.
To practice all areas of C language, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Get Free Certificate of Merit in C Programming
- Participate in C Programming Certification Contest
- Become a Top Ranker in C Programming
- Take C Programming Tests
- Chapterwise Practice Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Chapterwise Mock Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Practice BCA MCQs
- Practice Computer Science MCQs
- Apply for C Internship
- Buy C Books
- Apply for Computer Science Internship