Examveda

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int x = 3; //, y = 2;
    const int *p = &x;
    *p++;
    printf("%d\n", *p);
}

A. Increment of read-only location compile error

B. 4

C. Some garbage value

D. Undefined behaviour

Answer: Option C


This Question Belongs to C Program >> C Fundamentals

Join The Discussion

Related Questions on C Fundamentals