C Programming - C Preprocessor

6.
A macro must always be defined in capital letters.
True
False
Answer: Option
Explanation:

FALSE, The macro is case insensitive.


7.
Macros have a local scope.
True
False
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.
True
False
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.
True
False
Answer: Option
Explanation:

True, these macros are used for conditional operation.


#if <constant-expression>
#elif <constant-expression>
#endif

10.
Macros with arguments are allowed
True
False
Answer: Option
Explanation:

True, A macro may have arguments.

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