Question: Using C++ language : Please write a program using switch statements, with the following rules (see hint below the instructions). --------------------------------------------------------------------------------------- The only printf lines

Using C++ language :

Please write a program using switch statements, with the following rules (see hint below the instructions).

---------------------------------------------------------------------------------------

The only printf lines you can use are the following:

(you can only use each one once)

printf("Enter an integer (1-10) "); printf("A"); printf("B"); printf("C"); printf("D"); printf("E"); printf("F");

Ask the user to enter an integer.

Print A if the user enters 3 Print B if the user enters 1,2, or 3 Print C if the user enters 10 Print D if the user enters 5, 6, 7, or 10 Print E if the user enters 4 Don't print anything if the user enters 8 or 9 Print F if the user enters any other number not listed above.

Can follow this syntax format while you build the program

 Using C++ language : Please write a program using switch statements,

with the following rules (see hint below the instructions). --------------------------------------------------------------------------------------- The only

printf lines you can use are the following: (you can only use

each one once) printf("Enter an integer (1-10) "); printf("A"); printf("B"); printf("C"); printf("D");

printf("E"); printf("F"); Ask the user to enter an integer. Print A if

switch(expression) { case X: // code block break; case y: // code block break; default: // code block } #include using namespace std; int main() { int num=5; switch(num+2) { case 1: cout using namespace std; int main() { int i=2; switch(i) { case 1: cout using namespace std; int main({ int i=2; switch(i) { case 1: cout

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!