Vidyalelo
C Programming · Q136

Pointer

Programming · C Programming · question 136

Q136

What will be the output of the following C code? #include int main() int a[4] = 1, 2, 3, 4; int *ptr = &a[2]; float n = 1; ptr = ptr + n; printf("%d ", *ptr);

A.
4
B.
3
C.
Compile time error
Answer
D.
Undefined behaviour

Answer: Option C

Solution

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