In C#, the switch case statement checks one variable for various possible values (cases) and executes the case which is true. Switch case statements are mainly used in menu driven programs where various choices are thrown to user out of which 1 is to be chosen.


C# switch case Example:



  1. We can’t use two parameters in switch statement.
  2. The case value must be an integer.

Pin It on Pinterest

Share This