Sail E0 Webinar
Question
What is the output of this C code?
int main()
{
const int a;
a = 32;
printf("a is %d", a);
return 0;
}
Options:
A .  a is 32
B .  Compile time error
C .  Run time error
D .  none
Answer: Option B


Since the constant variable has to be declared and defined at the same time, not doing it results in an error.



Was this answer helpful ?

Submit Solution

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

Latest Videos

Latest Test Papers