Choose the correct answers to the questions from the given options. (Do not copy the questions, write only the correct answers.)
Assertion (A): In switch case break statement avoids fall through. Reason (R): break statement helps to execute only one case at a time.
Topic: switch-case and fall-through
Try it
Pick an option and check your answer. The full worked answer is below either way.
Answer
(a) Both (A) and (R) are true and (R) is a correct explanation of (A)..
Both statements are true, and the reason genuinely explains the assertion. Without break, control falls from the matching case into every case below it — that is fall-through. break transfers control out of the switch as soon as one case has run, which is precisely why fall-through is avoided. In assertion-reason questions always ask two things: are both true, and does the second explain the first?
Both (A) and (R) are true and (R) is a correct explanation of (A)..