All pastes #408002 Raw Edit

Unnamed

public text v1 · immutable
#408002 ·published 2007-03-24 14:30 UTC
rendered paste body
Write a JavaScript program which uses for loops to evaluate a base number raised to a an exponent.

Prompt the user for a base number.
Prompt the user for an exponent.
Evaluate the expression using for loops. (You are not allowed to use the Math.pow function.)
Print out the answer. Use the HTML super script tag to display the exponent.
Your program should work for any whole number exponent (positive, negative, or zero).
Example1: 
Computer>Enter a base: 
User> 5 
Computer> Enter an exponent: 
User> 3 
Computer>53 = 5 x 5 x 5 = 125