-Switch in C language is a conditional statement that are used to execute the code according to the conditions.
Syntax-
switch(variable)
{
case value1:
body;
case value2:
body;
.
.
.
.
}
program-
#include< stdio.h>
int main()
{
int a;
printf("Enter Number\n");
scanf("%d",&a);
switch(a)
{
case 1:
printf("case 1 is execute\n");
case 2:
printf("case 2 is execute\n");
}
print("After Switch");
}
Enter Number
2
case 2 is execute