Javatpoint Logo
Javatpoint Logo

C# switch

The C# switch statement executes one statement from multiple conditions. It is like if-else-if ladder statement in C#.

Syntax:

C# switch statement flow

C# Switch Example

Output:

Enter a number:
10
It is 10

Output:

Enter a number:
55
Not 10, 20 or 30

Note: In C#, break statement is must in switch cases.

Next TopicC# For Loop





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA