Important MCQ

The order of conditions in a ladder

Q.The order of conditions in a ladder

A) is random
B) matters
C) is decided by the compiler
D) does not matter
Correct Answer:
Option B
Detailed Explanation:
B) matters is correct. An else-if ladder tests multiple conditions in order. Once one condition is true, its block runs and the remaining branches are skipped; the final else handles no match.