Question 131

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

What is the output? int a = 5, b = 10; if (a > b) if (b > 0) printf("X"); else printf("Y");
  1. AXY
  2. BNo output
  3. CX
  4. DY
Show answerHide answer

Correct answer: (B) No output

Explanation

else pairs with the inner if; the outer if is false, so nothing prints.

From DSSSB TGT Computer Science Full Mock Test 5

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