What is the output? int a = 5, b;
What is the output?
int a = 5, b;
b = a++ * 2;
printf("%d %d", a, b);
Show answerHide answer
Correct answer: (B) 6 10
Explanation
a++ uses 5 then increments: b = 10, a = 6.
Correct answer: (B) 6 10
Explanation
a++ uses 5 then increments: b = 10, a = 6.
This is question 127 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.