Question discussion

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

359042Medium DSSSB TGT Computer Science 0 replies 0 views
0
In an if-else ladder, if a condition evaluates to true, what happens to the subsequent conditions?
  • AOnly the next condition is evaluated.
  • BOnly the last condition of the ladder is evaluated
  • CAll subsequent conditions are evaluated.
  • DNone of the subsequent conditions are evaluated.
Correct answer: D

Explanation

In an if-else ladder, once a condition is true its block runs and the remaining conditions are skipped.

Discussion 0

Nobody has replied yet. Start the discussion!