Skip to content
Related Articles

Related Articles

Improve Article

C | Macro & Preprocessor | Question 7

  • Difficulty Level : Medium
  • Last Updated : 06 Feb, 2013
Geek Week

Output?




# include <stdio.h>
# define scanf  "%s Geeks Quiz "
int main()
{
   printf(scanf, scanf);
   return 0;
}

(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”.

Take a step-up from those “Hello World” programs. Learn to implement data structures like Heap, Stacks, Linked List and many more! Check out our Data Structures in C course to start learning today.
My Personal Notes arrow_drop_up
Recommended Articles
Page :