+ 14
when U have so many cases , then its better to create use switch ... in place of many if-else if ... -else statements
+ 3
Switch is usually a replacement for a series of if-else-if statements:
https://en.m.wikipedia.org/wiki/Switch_statement
+ 1
switch statement is similar to else if statement.. but difference is, while using else if ,we are actually checking conditions( like per>75) but in switch statement we are assuming some constant value for each condition as case 1, 2 and so on....
So switch is useful for menu driven programming ...display menu (multiple tasks to execute) and ask user for choice ... and serve output of that choice.
+ 1
if you should do program of so many conditions or repeateadly
0
hi hor are you friends?