C Programming - C Preprocessor
Exercise : C Preprocessor - True / False Questions
6.
A macro must always be defined in capital letters.
Answer: Option
Explanation:
FALSE, The macro is case insensitive.
7.
Macros have a local scope.
Answer: Option
Explanation:
False, The scope of macros is globals and functions. Also the scope of macros is only from the point of definition to the end of the file.
8.
Every C program will contain at least one preprocessor directive.
Answer: Option
Explanation:
False, the preprocessor directive is not mandatory in any c program.
9.
Preprocessor directive #ifdef .. #else ... #endif is used for conditional compilation.
Answer: Option
Explanation:
True, these macros are used for conditional operation.
#if <constant-expression>
#elif <constant-expression>
#endif
10.
Macros with arguments are allowed
Answer: Option
Explanation:
True, A macro may have arguments.
Example: #define CUBE(X)(X*X*X)
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers