In multiple if statements the conditions are to checked as many times the if statements are written where as in switch conditiion the condition is checked only once and jumps to required block
Switch statement is useful when we are having multiple options for the same variable but when we have to use mutiple conditions simultaneously then it would be better to use if else.
The switch statement is better than multiple if statements when there are more than two alternatives to be selected whether the case value matches to the variable of either character or integer type.
Both statements has their own purpose. If the comparision is between switch and if statements only (not if-else construct) Switch is better to use provided the results of the check-condition are discreet values. Switch statement gives more clarity in code than multiple if construct.
The switch statement is a construct that is used when many conditions are being tested for. When there are many conditions it becomes too difficult and complicated to use the if and else if constructs. Nested if/else statements arise when there are multiple alternative paths of execution based on some condition that is being tested for.
In if statements to get required result we have to check many conditions first.this is time consuming.where as in switch statements we are switching to the result in less steps by case checking.
In multiple if statements the conditions are to checked as many times the if statements are written where as in switch conditiion the condition is checked only once and jumps to required block
Straight answer for this question is "When more than 2 conditions are there and condition variable is not a condition again (should be either character or integer)" If any thing is wong in this please let me know