Question
What is the output of this C code?
#define a 20
int main()
{
const int a = 50;
printf("a = %d\n", a);
}
#define a 20
int main()
{
const int a = 50;
printf("a = %d\n", a);
}
Answer: Option D
Was this answer helpful ?
The #define substitutes a with 20 leaving no identifier and hence compilation error.
Complilation Error: expected identifier or '(' before numeric constant
Was this answer helpful ?
Submit Solution