Hi there! Can i place one more statement into switch? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hi there! Can i place one more statement into switch?

i want to write program which tells zodiac

17th Dec 2018, 7:19 AM
Шохджахон Туракулов
Шохджахон Туракулов - avatar
1 Answer
+ 6
If you are referring to the expression that the switch evaluates then no it can't. But if you are referring to the statements inside the switch, then yes you can. switch(expression, statement) //no can do switch(expression) case foo: statement1 statement2 break case bar: statement1 statement2 statement3 break
17th Dec 2018, 8:01 AM
Lambda_Driver
Lambda_Driver - avatar