GATE | GATE CS 2019 | Question 33
Consider the following C program:
The number that will be displayed on execution of the program is _________ .
(D) segmentation error
Note that index of array always start from 0 in C.
Initially ip pointer is pointing at (arr+4) or skipping starting first 4 position.
Now in the printf system call, 1 more position is to skip, So it will point to (arr+5) or skip 5 position from starting:
Hence, printf will print value at 6th position, i.e., 6 will printed.
So, option (A) is correct.