Question: C++ Programming Write a program that will ask the user for two integer numbers. Use a for loop to raise the first number to the

C++ Programming

Write a program that will ask the user for two integer numbers.

Use a for loop to raise the first number to the power of the second number.

I recommend using the long type instead of int type.

Display the answer to the screen.

Example session (your messages may be different if you wish):

ITSE 1307 lab #4, John Q. Public

Enter a number: 5

Enter the power to raise

5 to: 3 5 to the 3 power is 125

Add a while loop or do while loop around your existing code:

Once the answer has been displayed, ask the user if they want to calculate another. Validate the user's response to be Y or N or y or n.

Example session:

ITSE 1307 lab #4, John Q. Public

Enter a number: 10

Enter the power to raise 10 to: 5

Working:

10 to the 5 power is 100000

Do you want to raise another number to a power? a

Please enter Y or N

Do you want to raise another number to a power? n

Goodbye, program is terminating.

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!