WHAT DOES A BREAK STATEMENT DO IN SWITCH STATEMENTS?

Sumit Kesarwani

Total Post:782

Points:3910
Posted by  Sumit Kesarwani
C# 
C#
 1319  View(s)
Ratings:
Rate this:
  1. Sumit Kesarwani

    Post:782

    Points:3910
    What does a break statement do in switch statements?

    The break statement terminates the loop in which it exists. It also changes the flow of the execution of a program.

    In switch statements, the break statement is used at the end of a case statement. The break statement is mandatory in C# and it avoids the fall through of one case statement to another.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!