Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

C | Macro & Preprocessor | Question 13

  • Difficulty Level : Medium
  • Last Updated : 14 Nov, 2019

Output of following C program?




#include<stdio.h>
#define max abc
#define abc 100
  
int main()
{
    printf("maximum is %d", max);
    return 0;
}

(A) maximum is 100
(B) abcimum is 100
(C) 100imum is 100
(D) abcimum is abc



Answer: (A)

Explanation: After pre-processing, the source code becomes:




int main()
{
    printf("maximum is %d", 100);
    return 0;
}

The “max” in maximum is not a token, so it doesn’t match with max while pre-processing.
So, option (A) is correct.

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :