223 views
1 votes
1 votes
Please tell the output and explain in detail.

#include<stdio.h>
#define A -B
#define B -C
#define C 5

int main()
{
  printf("The value of A is %d\n", A); 
  return 0;
} 

1 Answer

0 votes
0 votes
answer is 5

In the printf A will be replaced by -B and B will be replaced by -C. Thus it becomes simply C. again C will be further replaced by 5.

Happens due to macro replacements.

No related questions found