S
sam_cit
Hi Everyone,
In the following code, i have a common action for three switch cases,
is there any other better way to write the three values in a single
case?
Thanks in advance
#include <stdio.h>
int main()
{
int i = 1;
switch(i)
{
case 2: printf("before...\n");
break;
case 4:
case 5:
case 6: printf("in...\n");
break;
case 7: printf("out...\n");
break;
}
return(0);
}
In the following code, i have a common action for three switch cases,
is there any other better way to write the three values in a single
case?
Thanks in advance
#include <stdio.h>
int main()
{
int i = 1;
switch(i)
{
case 2: printf("before...\n");
break;
case 4:
case 5:
case 6: printf("in...\n");
break;
case 7: printf("out...\n");
break;
}
return(0);
}