Computer Science, asked by kumarkrishna5952, 7 months ago

.
When it is better to use switch statement instead of if-else ? why ?​

Answers

Answered by Anonymous
2

Answer:

Speed: A switch statement might prove to be faster than ifs provided number of cases are good. If there are only few cases, it might not effect the speed in any case. Prefer switch if the number of cases are more than 5 otherwise, you may use if-else too.....

Answered by manasgupta2506
2

Answer:

A switch statement might prove to be faster than ifs provided number of cases are good. If there are only few cases, it might not effect the speed in any case. Prefer switch if the number of cases are more than 5 otherwise, you may use if-else too.

I HOPE IT HELPS

MARK ME AS BRAINLIEST

Similar questions