Discussion :: C-MCQs
-
Whats is the output of this C code?
void main()
{
int const k = 11;
k++;
printf("k is %d", k);
}
A.
k is 12
|
B.
Error because const and int are used together
|
C.
garbage value
|
D.
Error, because a constant variable cannot be changed
|
Answer : Option D
Explanation :
Constant variable has to be declared and defined at the same time. Trying to change it later results in error.
Be The First To Comment