CPP Preprocessor Directives MCQCpp MCQ
- Preprocessor Directives
- Multiple Choice Question
(1) Which of the following preprocessor directive is used to include library files in source program ?
#include directive is used to include library/header files in source program. This directive is normally used in every small and large program.
(2) #endif directive is __________ with #if directive.
C) Not a Part
#endif directive is always used with #if directive. Which indicate the ending of #if directive.
(3) Define directives are normally written in.
A) Lower Case
B) Upper Case
C) Propper Case
Define directive are used to define Macros/Symbolic Constants and written in upper case.
(4) Which of the following use to temintae compilation process ?
#error directive is used to terminate compilation process, and can display some error message. It is normally used with #if directive.
(5) Which of the following directive is used to include conditional code in source program
D) All of these
#if, #ifdef and #ifndef all preprocessor directives that are used to include conditional code of lines in source code.
(6) #ifdef directive must include ____________ directive at end
#ifdef is selection directive it must ends with #endif
(7) Preprocessor directives are alway start with.
# symbol is used in the start of prerocessor name.
(8) Which of the following directive is used to define symbolic constant ?
#def define directive is used to define symbolic constants.
(9) Which of the following is not type of preprocessor directive?
All of these are preprocessor directives.
(10) Preprocessor directives are normally written __________ of the source program.
C) In Between
Preprocessor directives/instructions are the special lines of code. That are most commonly used to include library files, so that these are written at the top of source program.