0
7.9kviews
Explain switch case and if-else ladder with example.
1 Answer
written 5.1 years ago by | • modified 5.1 years ago |
Switch Case:
A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each switch case.
Example:
Program:
// Following is a simple program to demonstrate syntax of switch.
#include …