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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!