+ 14
when U have so many cases , then its better to create use switch ... in place of many if-else if ... -else statements
25th Feb 2018, 4:52 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 3
Switch is usually a replacement for a series of if-else-if statements: https://en.m.wikipedia.org/wiki/Switch_statement
25th Feb 2018, 4:26 PM
Sergiu Panaite
Sergiu Panaite - avatar
+ 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.
25th Feb 2018, 5:17 PM
Manorama
Manorama - avatar
+ 1
if you should do program of so many conditions or repeateadly
8th Mar 2018, 1:28 PM
Devendra Kanade
Devendra Kanade - avatar
0
hi hor are you friends?
3rd Mar 2018, 11:20 PM
ronaldo isaias