Computer Science, asked by sakshisingh116, 5 months ago

state the difference between a switch and if statements​

Answers

Answered by Niharika0401
2

Answer:

SWITCH allows expression to have integer based evaluation while IF statement allows both integer and character based evaluation. 5. 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.

Hope this answer helps you.......

Answered by TheRiskyGuy
1

Answer:

Based on the result of the expression in the 'if-else' statement, the block of statements will be executed. If the condition is true, then the 'if' block will be executed otherwise 'else' block will execute. The switch statement contains multiple cases or choices. The user will decide the case, which is to execute.

Similar questions