C Quiz – 110 | Question 2

The following program won’t compile because there’re space between macro name and open parenthesis.

filter_none

edit
close

play_arrow

link
brightness_4
code

#include "stdio.h"
  
#define MYINC   (  a  )  (  ( a )  +  1 )
  
int main()
{
  
 printf("GeeksQuiz!");
  
 return 0;
}

chevron_right


(A) TRUE
(B) FALSE


Answer: (B)

Explanation: Please note that #define is a preprocessor directive i.e. it’s processed before actual compilation takes place. In the above program snippet MYINC isn’t used in the program anywhere. So even though MYINC doesn’t perform the intended behaviour i.e. it won’t increment a, but MYINC is a valid macro. If we had used MYINC anywhere in the program, it would have been replaced with “( a ) ( ( a ) + 1 )”. So above program will compile and run without any issue.

Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.