A Alvin Le Member Sep 21, 2021 #1 What will be the output of the following C code? Code: #include<stdio.h> #define max 100 main() { #ifdef max printf("hello"); } A. 100 B. hello C. “hello” D. error
What will be the output of the following C code? Code: #include<stdio.h> #define max 100 main() { #ifdef max printf("hello"); } A. 100 B. hello C. “hello” D. error
L Lê Minh Member Sep 21, 2021 #2 Answer: d Explanation: The code shown above results in an error. This is because the preprocessor #endif is missing in the above code. If the identifier is defined, then the statements following #ifdef are executed till #endif is encountered. Upvote 0 Downvote
Answer: d Explanation: The code shown above results in an error. This is because the preprocessor #endif is missing in the above code. If the identifier is defined, then the statements following #ifdef are executed till #endif is encountered.