Question
//in c++ /* The purpose of this lab is to utilize 'goto' statement by creating a menu 1. Ask the users for 2 integer values
//in c++
/* The purpose of this lab is to utilize 'goto' statement by creating a menu 1. Ask the users for 2 integer values 2. Define a label 'choice' , prompt the user with 3 choices ( add , subtract, multiply) 3. Use 'if else if..else' statements to navigate the choices, if choice 1 is selected, then go to label add and do the proper action, output the result and come back to the label choice , use 'goto' choice, do the same for sub,mult. 4. Define labels ( choice , add , subt, mul , end) */ #include
// Declare two integers // Prompt the user to enter two values // Scan the two values to the declared integers // Defining a choice label choice: cout<<"Select a choice: " "1 for addition " "2 for subtraction " "3 for multiplication " "any other number to quit"< mult: // Output the multiplication of the two variables // Go to the label choice to prompt the user to select a choice End: 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