Use of switch in C language.
#include <stdio.h>
int main(int argc, char const *argv[])
{
int a=11;
while (a != 10)
{
// switch case
printf("Enter Number :");
scanf("%d", &a);
switch (a)
{
case 0:
{
printf("%d :zero is the number.\n", a);
break;
}
case 1:
{
printf("%d :one is the number.\n", a);
break;
}
case 2:
{
printf("%d :two is the number.\n", a);
break;
}
case 3:
{
printf("%d :three is the number.\n", a);
break;
}
default:
{
printf("Not valid input.\n");
break;
}
}
}
return 0;
}