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
Science,
3 months ago
Math,
3 months ago
Biology,
6 months ago
Chemistry,
6 months ago
World Languages,
11 months ago
Social Sciences,
11 months ago