-
What will be the output of the following C code?
#include <stdio.h>
int main()
{
const int k = 11;
int *p = &k;
*p = 22;
printf("%d\n", k);
return 0;
}
-
- 11
- Compilation Error
- 22
- Runtime Error
- None of these
Correct Option: C
Changing const variable through non-constant pointers invokes compiler warning.