Question 127

What is the output? int a = 10, b = 3;

What is the output? int a = 10, b = 3; printf("%d", a % b * 2);
  1. A0
  2. B2
  3. C1
  4. D6
Show answerHide answer

Correct answer: (B) 2

Explanation

% and * have equal precedence, left to right: (10 % 3) * 2 = 2.

From DSSSB TGT Computer Science Full Mock Test 3

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