Vidyalelo
C Programming · Q220

C Fundamentals

Programming · C Programming · question 220

Q220

What will be the output of the following C code? #include int main() const int i = 10; int *ptr = &i; *ptr = 20; printf("%d ", i); return 0;

A.
Compile time error
B.
Compile time warning and printf displays 20
Answer
C.
Undefined behaviour
D.
10

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board