What is the difference between switch statement and if-00752
This subjective question is related to the book/course vu cs504 Software Engineering - I. It can also be found in vu cs504 Mid Term Solved Past Paper No. 1.
Question 1: What is the difference between switch statement and if statement.
Answer:
- IF statement is used when we have to check two conditions while switch is a multi conditional control statement.
- SWITCH statement can be executed with all cases if the "break" statement is not used whereas IF statement has to be true to be executed further.