C Language MCQ’S | C Preprocessor 7

Which of the following are correct preprocessor directives in C?

1: #ifdef
2: #if
3: #elif
4: #undef

A. 1, 2
B. 4
C. 1, 2, 4
D. 1, 2, 3, 4


Which of the following are correctly formed #define statements in C?

A. #define CUBE (X) (X*X*X);
B. #define CUBE(x) (X*X*X)
C. #define CUBE(X)(X*X*X)
D. #define CUBE(X) {X*X*X}


If the file to be included doesn’t exist, the preprocessor flashes an error message.

A. True
B. False


Preprocessor directive #undef can be used only on a macro that has been #define earlier

A. True
B. False


There exists a way to prevent the same file from getting #included twice in the same program.

A. True
B. False