If-else statements vs Switch | Sololearn: Learn to code for FREE!

0

If-else statements vs Switch

Which of these is more conventional to use

2/3/2017 8:37:13 AM

Sadat Adams

5 Answers

New Answer

+6

If you don't have any "else if"s then there's not much point in using a switch.

+6

Can't float, double and string or do bools in switch. Other than that, switch structures are much more compact.

+6

Switching a float, double, string is not feasible.

+5

@Hatsy Rei What do you mean you can't?

+1

personally i like using if staments more. because i think they are more convenient in comparing and i think they are more flexibel.