Question: Assuming the following variables and code has been written, complete the C++ code by writing a do while loop that will calculate the product of

Assuming the following variables and code has been written, complete the C++ code by writing a do while loop that will calculate the product of all of the values between a lower bound and 6, inclusive. After the loop, display the calculated product. For example, if the user enters 3 as the lower bound, then the loop should multiple 3 * 4 * 5 * 6 to get a product of 360 and then 360 should be displayed. You may assume that the lower bound that the user enters will be less than or equal to 6. Make sure to declare any other variables that are needed

int product, //holds the product of the values lowerBd; //holds the lower bound of the values to be multiplied cout << "What is the lower bound? "; cin >> lowerBd;

Then, REWRITE THE PROGRAM WITH A FOR LOOP AND A WHILE LOOP.

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!