Question 127

What is the output? int a = 5, b;

What is the output? int a = 5, b; b = a++ * 2; printf("%d %d", a, b);
  1. A5 10
  2. B6 10
  3. C6 12
  4. D5 12
Show answerHide answer

Correct answer: (B) 6 10

Explanation

a++ uses 5 then increments: b = 10, a = 6.

From DSSSB TGT Computer Science Full Mock Test 1

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.