Alk
asked on
Style issue
I want to write x to be squared, ie x2 but the 2 is to the power of x.
how do i get the 2 like that??
how do i get the 2 like that??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
lol, thats what he ****ing meant.
sorry,
!!!
RB
(should have got points for effort tho, hehe)
sorry,
!!!
RB
(should have got points for effort tho, hehe)
ASKER
Excellent
Sorry for the confusion!!
Sorry for the confusion!!
<script>
var x = 2;
document.write("square of x: " + parseFloat((x * x)))
var y = Math.pow(x, 2);
document.write("y = xpower of 2: " + y)
//i think you might want this
var pow = 3; //power of newx
var newx = 5;
var curnum = newx;
for (var i=0;i<(pow+1);i++){
curnum = curnum * curnum;
}
document.write(newx + " to the power of " + pow + " is " + curnum)
</script>