Question 131

What is the output? int a[] = {10, 20, 30, 40};

What is the output? int a[] = {10, 20, 30, 40}; int *p = a; p += 2; printf("%d", *p);
  1. A30
  2. B20
  3. C40
  4. D12
Show answerHide answer

Correct answer: (A) 30

Explanation

p moves two elements ahead to a[2] = 30.

From DSSSB TGT Computer Science Full Mock Test 1

This is question 131 of DSSSB TGT Computer Science Full Mock Test 1. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.