+ 1

What is switch case?

16th Jan 2017, 2:09 AM
ritesh
3 Answers
+ 7
Its a conditional, like if case. you can evaluate more cases with switch. switch(x){ case 0: //do code0 case 1; //do code1} Its like if (x == 0) code0; if(x==1)code1;
16th Jan 2017, 2:16 AM
Nahuel
Nahuel - avatar
0
switch is an alternative to nested if else selection
16th Jan 2017, 11:51 AM
Tuchy
Tuchy - avatar
0
Both the above mentioned answers are correct
16th Jan 2017, 12:39 PM
Ajay Shinde
Ajay Shinde - avatar