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);
Show answerHide answer
Correct answer: (A) 30
Explanation
p moves two elements ahead to a[2] = 30.
Correct answer: (A) 30
Explanation
p moves two elements ahead to a[2] = 30.
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.