Top

Discussion

What is the output of this C code?

int main()
{
const int a;
a = 32;
printf("a is %d", a);
return 0;
}

 

  • A.a is 32
  • B.Compile time error
  • C.Run time error
  • D.none

Answer: B

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

No comment is present. Be the first to comment.
Loading…

Post your comment