Question:When is a switch statement better than multiple if statements?
Answer
A switch statement is generally best to use when you have more than two conditional expressions based on a single variable of numeric type.