What is the difference between switch statement and if-00752

Online Quiz 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:
  1. IF statement is used when we have to check two conditions while switch is a multi conditional control statement.
  2. 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.

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background