Ticker

6/recent/ticker-posts

HTML - HyperText Markup Language

HTML and Javascript code to calculate simple interest 

<!DOCTYPE html>

<html>

<head>

<title>Smiple Interest</title>

<script language="javascript">

function SimpleInterest()

{var p,r,t,si;

p=parseInt(document.prt.p.value);

r=parseInt(document.prt.r.value);

t=parseInt(document.prt.t.value);

if (p<=0)

{

alert("Wrong Input");

}

else


{

si=p*r*t/100;

alert(si);

}

}

</script>

</head>

<body>

<form name="prt">

Enter Principal amount<input type="text" name="p"><br>

Enter Rate<input type="text" name="r"><br>

Enter time<input type="text" name="t"><br>

<input type="button" name="display" value="calculation" onclick="SimpleInterest();">

</form>

</body>

</html>

Post a Comment

0 Comments