HOME

Wednesday, November 4, 2015

CALCULATE EXPONENT OF GIVEN NUMBER BY USING TEXT BOX

<html>
<head>
<script    language="javascript">
function calculate(a,b)
{
var i,c=1;
for(i=0;i<b;i++)
{
c*=a;
}
f1.t3.value=c;
}
</script>
<body>
<form name="f1">
<label>number</label><input type="text" name="t1" value="0"><br>
<label>expontional</label><input type="text" name="t2" value="0"><br>
<label>number</label><input type="text" name="t3" value="0"><br>
<input type="button" value="calculate"onclick="calculate(f1.t1.value,f1.t2.value)">
<input type="reset" value="clear">
</form>
</body>
</html>

No comments:

Post a Comment