1.

What Is The Difference Between A Switch Statement And An If Statement?

Answer»

If statement is used to select from two alternatives. It uses a boolean expression to DECIDE which alternative should be executed. The expression in if must be a boolean VALUE. The SWITCH statement is used to select from multiple alternatives. The case values must be promoted to an to INT value.

If statement is used to select from two alternatives. It uses a boolean expression to decide which alternative should be executed. The expression in if must be a boolean value. The switch statement is used to select from multiple alternatives. The case values must be promoted to an to int value.



Discussion

No Comment Found