Exercise: C Preprocessor

Questions for: C Preprocessor

A header file contains macros, structure declaration and function prototypes.
A:
True
B:
False
C:
D:
Answer: A

True, the header file contains classes, function prototypes, structure declaration, macros.

In a macro call the control is passed to the macro.
A:
True
B:
False
C:
D:
Answer: B

False, Always the macro is substituted by the given text/expression.

Macros with arguments are allowed
A:
True
B:
False
C:
D:
Answer: A

True, A macro may have arguments.

Example: #define CUBE(X)(X*X*X)

Preprocessor directive #ifdef .. #else ... #endif is used for conditional compilation.
A:
True
B:
False
C:
D:
Answer: A

True, these macros are used for conditional operation.


#if <constant-expression>
#elif <constant-expression>
#endif
Every C program will contain at least one preprocessor directive.
A:
True
B:
False
C:
D:
Answer: B

False, the preprocessor directive is not mandatory in any c program.

Ad Slot (Above Pagination)
Quiz