Advertisements
Advertisements
Question
Assertion (A): In switch case break statement avoids fall through.
Reason (R): break statement helps to execute only one case at a time.
Options
Both (A) and (R) are true and (R) is a correct explanation of (A).
Both (A) and (R) are true and (R) is not a correct explanation of (A).
(A) is true and (R) is false.
(A) is false and (R) is true.
MCQ
Assertion and Reasoning
Advertisements
Solution
Both (A) and (R) are true and (R) is a correct explanation of (A).
Explanation:
The break statement causes the control to exit the switch–case block, preventing fall-through and ensuring that only the matching case or cases are executed.
shaalaa.com
Is there an error in this question or solution?
2024-2025 (March) Official Board
