C Programming - C Preprocessor - Discussion
Discussion Forum : C Preprocessor - Point Out Correct Statements (Q.No. 1)
1.
Which of the following are correct preprocessor directives in C?
1: | #ifdef |
2: | #if |
3: | #elif |
4: | #undef |
Answer: Option
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.
Discussion:
2 comments Page 1 of 1.
Nitesh said:
5 years ago
@Preeti
1.) As we use If Condition in our basic program like that in Macro we use #if #elif #endif.
2.) #undef = It used to undefine the define Macro.
Example. #define PI 3.14.
#undef PI // It will destroy PI so now there is no PI exists.
3.) #ifdef = Used to check Macro is Defined or Not.
1.) As we use If Condition in our basic program like that in Macro we use #if #elif #endif.
2.) #undef = It used to undefine the define Macro.
Example. #define PI 3.14.
#undef PI // It will destroy PI so now there is no PI exists.
3.) #ifdef = Used to check Macro is Defined or Not.
Preeti said:
1 decade ago
What is the use of #if ?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers