With int a[4] = {5, 10, 15, 20}; what does *(a + 3) - *(a + 1) evaluate to?
-
A
10
Correct answer
-
B
5
-
C
15
-
D
20
13 views
Explanation
Pointer arithmetic steps by whole elements, so the expression subtracts 10 from 20 and yields 10.
Reference
Asked in: NTS, PPSC IT, Campus Interviews
Doubts & discussion
Not sure why the answer is A? Ask here and get an explanation.
Ask a doubt about this MCQ