+ 1
Hi i'am confused about this C program
i want to add the outher months to the switch statement but i dont know how to do it (for exemple i want to collect all the summer months in the same statement) https://code.sololearn.com/c1mT4pl2fJ50/?ref=app
4 Answers
+ 2
It's called "case fall through"
example
case 3 :
case 4 :
case 5 :
printf ("Its spring");
break;
+ 1
can I use ?
case 3 && 4 && 5 :
printf("its spring")
break ;
+ 1
No...but there is a non-standard way of doing similar.
example
case 3 ... 5 : // a number, a space, 3 dots, a space then the number.
0
#rodwynnejones
thank you