difference between if statements and switch case statements.
Answers
Answered by
20
if statement which checks whether the condition is true or false
Switch statement which has a number of choices to choose from under different cases
Switch statement which has a number of choices to choose from under different cases
nancyyy:
can you give another point please
Answered by
25
Short note on if and switch case statements:
= > if statements validates multiple conditions at a time. Switch can validate only one condition at a time.
= > In if statements we cannot define default statement. Switch statement we can define default statement.
= > if statements works under the Boolean literal.Switch statement works under integer literal.
Hope it helps!
Similar questions
Math,
7 months ago
Art,
7 months ago
Physics,
7 months ago
Math,
1 year ago
Social Sciences,
1 year ago
Computer Science,
1 year ago