![]() |
VOOZH | about |
Basically, Simple Interest is a quick method to calculate the interest charge of a loan. It is determined by multiplying the principal amount by the daily interest rate by the number of days which elapse between the payments. It gets estimated day to day-with the help of mathematical terms.
we will create a program to calculate simple interest in R Programming Language.
Simple Interest = (P x R x T)/100Here we create an R program to calculate Simple Interest:
Output:
Simple Interest: 6000In the mentioned program, define a function like 'calculate_simple_interest' which takes three arguments called 'principal', 'rate', and 'time'. Then the function used the Formula for Calculating the Simple Interest.
Example 2: Here's another approach to calculating simple interest in R using a more concise method
Output:
Principal amount: $ 1000
Rate of interest: 5 %
Time: 2 years
Simple Interest: $ 100