To evaluate the single expression which one is more preferable “switch” or “if”?

: 549
Paper : C Programming FAQ (Frequently Asked Questions and answers) for freshers | Platform : Procedural Programming Languages | Category : Programming FAQs

When the selection is based on a single expression or variable then prefer switch statement over if. The switch statement works commendably with integer and character data types.

Suggested Papers: