Skip to main content
Write a JavaScript program to calculate simple Interest (p*r*n/100).
CODING:
<html>
<head>
<title>
</title>
<script>
function prn(){
var p,r,n,i;
p=document.getElementById("pr").value;
r=document.getElementById("rt").value;
n=document.getElementById("ya").value;
i=p*r*n/100;
document.getElementById("ans").value=i;
}

</script>
</head>
<body>
PRICE: <input type="text"  id="pr" placeholder="Enter The Number"><br><br>
RATE:  <input type="text"  id="rt" placeholder="Enter The Number"><br><br>
YEAR:<input type="text"  id="ya" placeholder="Enter The sum of year"><br><br>
<input type="button" value="INTERSET"  onclick="prn()">
<input type="text"   id="ans" placeholder="Simple Interset is" >
</body>
</html>

Comments