← Back to Loops
Question 43
Power with a Loop
Power with a Loop
Read two integers, a base and an exponent (both on the input, base first). Use a loop to compute base raised to the exponent WITHOUT using pow(). Print the result.
Example: input '2 5' means 2 to the power 5, so print 32.Expected Output:
32= newline. No newline after the last line.
Hints4 available
Sign in to use hintsTopics:
Loops
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.