Skip to content
Related Articles
Open in App
Not now

Related Articles

C Quiz – 110 | Question 2

Improve Article
Save Article
  • Difficulty Level : Easy
  • Last Updated : 28 Jun, 2021
Improve Article
Save Article

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()
 return 0;


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
Related Articles

Start Your Coding Journey Now!