C Programming MCQ - 1 [ Cannot Modify Constant Value ]
Question : What will be the Output of the Program.?
#include<stdio.h> void main() { int const * p=5; printf("%d",++(*p)); }
Answer
Compiler error: Cannot modify a constant value
Explanation :
- p is a pointer to a “Constant Integer“.
- We tried to change the value of the “Constant Integer“.
- Value of the Constant Integer Cannot Be Modified.