C Programming - C Preprocessor
|
|
|
|
Exercise"When ambition ends, happiness begins."
- (Proverb)
|
| 1. |
Which of the following are correct preprocessor directives in C?
| 1: |
#ifdef |
| 2: |
#if |
| 3: |
#elif |
| 4: |
#undef |
|
Answer: Option C
Explanation:
The macros #ifdef #if #elif are called conditional macros.
The macro #undef undefine the previosly declared macro symbol.
Hence all the given statements are macro preprocessor directives.
|
| 2. |
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} |
Answer: Option C
Explanation:
No answer description available for this question. Let us discuss.
|
|
|