Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the following program #include #include using namespace std; int main() { int choice; // Menu choice should be 1, 2, or 3 // Display

Use the following program

#include #include using namespace std; int main() { int choice; // Menu choice should be 1, 2, or 3 // Display the menu of choices cout << "Choose a primary color by entering its number. "; cout << "1 Red " << "2 Blue " << "3 Yellow "; // Get the user's choice cin >> choice; // Tell the user what he or she picked if (choice == 1) cout << "You picked red. "; else if (choice == 2) cout << "You picked blue. "; else cout << "You picked yellow. "; return 0;

}

* Output in here means what is shown in the console window. For example, cout<<"Hello world! "; outputs Hello World!

What is the output of the program if user entered 1?

What is the output of the program if user entered 2?

What is the output of the program if the user entered 0?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

2. Show the trainees how to do it without saying anything.

Answered: 1 week ago