Question:When is a “switch” statement preferable over an “if” statement? 

Answer The switch statement is best used when dealing with selections based on a single variable or expression. However, switch statements can only evaluate integer and character data types. 

+ Report
Total Preview: 945
When is a “switch” statement preferable over an “if” statement?
Copyright © 2024. Powered by Intellect Software Ltd