when to use switch case in c++?
Answers
Answered by
14
The constant-expression for a case must be the same data type as the variable in the switch, and it must be a constant or a literal. When the variable being switched on is equal to a case, the statements following that case will execute until a break statement is reached.
Hope it helps....
Please Mark me as Brainliest
Hope it helps....
Please Mark me as Brainliest
jainshruti639:
If u have same variable and check out variable to different data instead of using if else if condition u can go through a switch case statement
Answered by
1
hi....
The constant-expression for acase must be the same data type as the variable in theswitch, and it must be a constant or a literal. When the variable being switched on is equal to a case, the statements following that case will execute until a break statement is reached.
The constant-expression for acase must be the same data type as the variable in theswitch, and it must be a constant or a literal. When the variable being switched on is equal to a case, the statements following that case will execute until a break statement is reached.
Similar questions