Javascript Program to Enter the P, T, R, and Calculate it's Simple Interest
ADVERTISEMENTS
Javascript program to enter the P, T, R, and calculate its Simple Interest.
In this article, you will learn how to find the Simple Interest through P, T, and R in javascript language.
Example
Simple Interest = 21.6
You should have knowledge of the following topics in javascript to understand this program.
- JavaScript variables
- document.write
Simple Interest Formula
SI = (P * T * R) / 100
Where
P = Principal Amount
T = Time
R = Rate
SI = Simple Interest
Source Code
<!-- Javascript Program to Enter the P, T, R, and Calculate its Simple Interest -->
<script type="text/javascript">
var p, t, r, SI;
// p = principal, t = time, r = rate, SI = simple interest
// It will calculate the simple interest
p = 15;
t = 12;
r = 12;
SI = (p * t * r) / 100;
// It will print the final output
document.write("Simple Interest = " + SI);
</script>
Output
Simple Interest = 21.6
Explanation
In this given program, we have pre-assigned the values of Principle, Time, and Rate the following 15
, 12
, and 12
then we applied the interest calculation formula to these given values.
Then, It will return the simple interest value of 21.6
the final output of this program.