Computer Science, asked by Misswonder, 1 month ago

In if statement and switch case which is better and why?​

Answers

Answered by kamanasri
1

Explanation:

A switch statement is usually more efficient than a set of nested ifs. The compiler can do this because it knows that the case constants are all the same type and simply must be compared for equality with the switch expression, while in case of if expressions, the compiler has no such knowledge. .

Similar questions