Computer Science, asked by iiiiooooiiioooiii, 4 months ago

what is the purpose of break and defalt in a switch !?​

Answers

Answered by DynamicPlayer
7
  1. If no break appears, the flow of control will fall through to subsequent cases until a break is reached. A switch statement can have an optional default case, which must appear at the end of the switch. The default case can be used for performing a task when none of the cases is true.
Answered by HellSpark
16

If no break appears, the flow of control will fall through to subsequent cases until a break is reached. A switch statement can have an optional default case, which must appear at the end of the switch. The default case can be used for performing a task when none of the cases is true.

Similar questions