+ 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

7th Dec 2020, 5:44 PM
BAQQAL Hamza
BAQQAL Hamza - avatar
4 Answers
+ 2
It's called "case fall through" example case 3 : case 4 : case 5 : printf ("Its spring"); break;
7th Dec 2020, 5:57 PM
rodwynnejones
rodwynnejones - avatar
+ 1
can I use ? case 3 && 4 && 5 : printf("its spring") break ;
7th Dec 2020, 6:04 PM
BAQQAL Hamza
BAQQAL Hamza - avatar
+ 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.
7th Dec 2020, 6:11 PM
rodwynnejones
rodwynnejones - avatar
0
#rodwynnejones thank you
7th Dec 2020, 6:14 PM
BAQQAL Hamza
BAQQAL Hamza - avatar