Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started