Sail E0 Webinar
Question
What is the output of this C code?
#define a 20
int main()
{
const int a = 50;
printf("a = %d\n", a);
}
Options:
A .  a = 50
B .  a = 20
C .  Run time error
D .  Compilation Error
Answer: Option D


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 ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers