Write any program in c++ containing switch
Answers
Answered by
1
The switch statement allows us to execute a block of code among many alternatives.
The syntax of the switch statement in C++ is:
switch (expression) {
case constant1:
// code to be executed if
// expression is equal to constant1;
break;
case constant2:
// code to be executed if
// expression is equal to constant2;
break;
.
.
.
default:
// code to be executed if
// expression doesn't match any constant
}
Similar questions
Math,
2 months ago
Math,
2 months ago
Math,
2 months ago
Biology,
4 months ago
Chemistry,
4 months ago
World Languages,
10 months ago
Social Sciences,
10 months ago