Question 129

What is the output? int arr[] = {2, 4, 6, 8};

What is the output? int arr[] = {2, 4, 6, 8}; int *p = arr + 1; printf("%d %d", *p, p[1]);
  1. A4 8
  2. B2 4
  3. C6 8
  4. D4 6
Show answerHide answer

Correct answer: (D) 4 6

Explanation

p points to arr[1] = 4; p[1] = arr[2] = 6.

From DSSSB TGT Computer Science Full Mock Test 5

This is question 129 of DSSSB TGT Computer Science Full Mock Test 5. 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.