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]);
Show answerHide answer
Correct answer: (D) 4 6
Explanation
p points to arr[1] = 4; p[1] = arr[2] = 6.
Correct answer: (D) 4 6
Explanation
p points to arr[1] = 4; p[1] = arr[2] = 6.
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.