Skip to content
Related Articles

Related Articles

C Quiz – 110 | Question 2
  • Difficulty Level : Basic
  • Last Updated : 24 Oct, 2015

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




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

(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

Want to learn from the best curated videos and practice problems, check out the C Foundation Course for Basic to Advanced C.
My Personal Notes arrow_drop_up
Recommended Articles
Page :