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
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