Computer Science, asked by ankitsagar613, 5 months ago

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

Answers

Answered by Anonymous
52

\huge\boxed{\fcolorbox{purple}{ink}{Answer}}

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 MissAlison
2

\huge\sf\underline{\pink{AnsWeR}}

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