- A series of if-else if statements are less elegant for menu selection.Switch offers a better alternative.
- Relational & logical operators can be used in if whereas switch can only test for equality.
Apart from these can you think of any differences between switch & if? There is a question in my text book which says "How switch is different from if statement?Illustrate through an example."
Thanks for your time