Advertisements
Advertisements
Question
In a switch case, when the switch value does not match with any case then the execution transfers to the default case.
Options
True
False
MCQ
True or False
Solution
This statement is True.
Explanation:
In a switch statement, control is transferred to the default case if none of the case values match the switch expression. When none of the other cases match, the default case is run. If there is no default case or match, the switch statement will simply exit.
shaalaa.com
Is there an error in this question or solution?