Concept Flow - Switch vs if comparison
Start
Evaluate expression
Switch: Match case?
Yes→Execute case block
Default case
If: Evaluate conditions one by one
Condition true?
Yes→Execute if block
Check next condition
End
Both switch and if check conditions to decide which code to run; switch matches one value, if checks conditions in order.