xxxxxxxxxx
Expression is evaluated and SWITCH statement is run according to the result of the expression that can be integer or logical while IF statement is run only if the result of the expression is true.
xxxxxxxxxx
In if-else, the values are based on conditions.
In the switch case, the values are based on user preference.
In case, the situation gets false in the if statement,
it will automatically execute the else statement.