What is the output? int a = 10, b = 3;
What is the output?
int a = 10, b = 3;
printf("%d", a % b * 2);
Show answerHide answer
Correct answer: (B) 2
Explanation
% and * have equal precedence, left to right: (10 % 3) * 2 = 2.
Correct answer: (B) 2
Explanation
% and * have equal precedence, left to right: (10 % 3) * 2 = 2.
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.