C | Macro & Preprocessor | Question 7
Output?
# include <stdio.h> # define scanf "%s Geeks Quiz " int main() { printf(scanf, scanf); return 0; } |
chevron_right
filter_none
(A) Compiler Error
(B) %s Geeks Quiz
(C) Geeks Quiz
(D) %s Geeks Quiz Geeks Quiz
Answer: (D)
Explanation: After pre-processing phase of compilation, printf statement will become.
printf(“%s Geeks Quiz “, “%s Geeks Quiz “);
Now you can easily guess why output is “%s Geeks Quiz Geeks Quiz”.
Recommended Posts:
- C | Macro & Preprocessor | Question 14
- C | Macro & Preprocessor | Question 10
- C | Macro & Preprocessor | Question 4
- C | Macro & Preprocessor | Question 8
- C | Macro & Preprocessor | Question 6
- C | Macro & Preprocessor | Question 15
- C | Macro & Preprocessor | Question 5
- C | Macro & Preprocessor | Question 1
- C | Macro & Preprocessor | Question 2
- C | Macro & Preprocessor | Question 14
- C | Macro & Preprocessor | Question 12
- C | Macro & Preprocessor | Question 11
- C | Macro & Preprocessor | Question 13
- C | Macro & Preprocessor | Question 9
- The OFFSETOF() macro



