What are the differences between switch case and If statement.
IF STATEMENTS | SWITCH CASE |
---|---|
If statement is used to select among two alternatives of 'True' i.e. condition is fulfilled and 'False' i.e. condition is not fulfilled. | The switch statement is used to select among multiple alternatives. |
It is a decision making control statement. | It is a selection statement. |
The if statement in C, makes sections based on a single true or false condition. | Switch case offers multiple choice for selection of the statements or we can switch case. |
It is a linear... |