Question: Use the below code (called a switch) and covert it to IF statements: 1. include using namespace std; int main () { int x =
Use the below code (called a switch) and covert it to IF statements:
1.
include
using namespace std;
int main () {
int x = 2;
switch (x)
{
case 1:
cout << "Choice is 1";
break;
case 2:
cout << "Choice is 2";
break;
case 3:
cout << "Choice is 3";
break;
default:
cout << "Choice other than 1, 2 and 3";
breal;
}
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
