• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

C Macro & Preprocessor

Question 21

C
#include <stdio.h>
#if X == 3
    #define Y 3
#else
    #define Y 5
#endif

int main()
{
    printf(\"%d\", Y);
    return 0;
}

What is the output of the above program?
 

  • 3
     

  • 5
     

  • 3 or 5 depending on value of X
     

  • Compile time error
     

There are 21 questions to complete.

Last Updated :
Take a part in the ongoing discussion