what is the importance of break and Default statement in switch
Answers
Answered by
4
break statement is used to bring the program control out of the switch expression while default statement is the last statement of the switch case.it is an optional statement.It executes only when the value stored in switch expression does not match with any case.
Answered by
0
Answer:
The break statement takes the flow of control out of the switch statement. Without the break statement, execution would simply continue to the next case. The default is the last statement of the switch case. It is an optional statement. It executes only when the values stored in switch expression does nat match any case
Similar questions
Social Sciences,
8 months ago
Geography,
8 months ago
Physics,
8 months ago
Biology,
1 year ago
Physics,
1 year ago