Computer Science, asked by susiemorningstar6, 2 months ago

what are two important statements we use in switch ​

Answers

Answered by 311156
1

Explanation:

I hope it will be useful for you

Please make as brainlist answer

Attachments:
Answered by Anonymous
1

Answer:

Some Important rules for switch statements :  

 

  • Duplicate case values are not allowed.
  • The value for a case must be of the same data type as the variable in the switch.  
  • The value for a case must be a constant or a literal. Variables are not allowed.
  • The break statement is used inside the switch to terminate a statement sequence.
  • The break statement is optional. If omitted, execution will continue on into the next case.
  • The default statement is optional and can appear anywhere inside the switch block. In case, if it is not at the end, then a break statement must be kept after the default statement to omit the execution of the next case statement.

Hope it helps you

Thank you..!!

:-)

Similar questions