Question
#include<stdio.h>
int main()
{
const int x;
x=128;
printf("%d\n", x);
return 0;
}
Point out the error in the program.
#include<stdio.h>
int main()
{
const int x;
x=128;
printf("%d\n", x);
return 0;
}
Answer: Option B
Was this answer helpful ?
A const variable has to be initialized when it is declared. later assigning the value to the const
variable will result in an error "Cannot modify the const object".
Hence Option B is correct
Was this answer helpful ?
Submit Solution