Switch case and Break

You have to use break/goto ,If there are multiple cases inside switch.
In last case the break statement is optional.

int x=7
switch (x)
{
default:
Response.Write(“Default”) ;
goto case 3;
case 1:
Response.Write(“Case 1”);
break;
case 2:
Response.Write(“Case 2”);
goto case 3;
case 3:
Response.Write(“Case 3”);
break;
}
If you will not write the break statement then the following compile time error will occur.
Please check the image bellow.
Compile error