Question 38Asked in DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)

In an if-else ladder, if a condition evaluates to true, what happens to the subsequent

In an if-else ladder, if a condition evaluates to true, what happens to the subsequent conditions?
  1. AOnly the next condition is evaluated.
  2. BOnly the last condition of the ladder is evaluated
  3. CAll subsequent conditions are evaluated.
  4. DNone of the subsequent conditions are evaluated.
Show answerHide answer

Correct answer: (D) None of the subsequent conditions are evaluated.

Explanation

In an if-else ladder, once a condition is true its block runs and control skips the rest of the ladder, so later conditions are not checked.

From DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 3 (5:00 PM)

This is question 38 of DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 3 (5:00 PM). 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.