1. Home
  2. Computer Science MCQs
  3. C Programming
  4. With int a[4] = {5, 10, 15, 20}; what does *(a + 3) - *(a…

Added 30 Nov -0001

With int a[4] = {5, 10, 15, 20}; what does *(a + 3) - *(a + 1) evaluate to?

  1. 10 Correct answer
  2. 5
  3. 15
  4. 20

Correct answer

A. 10

13 views

MCQSEXAM

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

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More C Programming MCQs

Practise all C Programming MCQs

Similar MCQs