Compound interest is the sum of principal amount and interest of interest.
Given, principal, rate, and time, we have to calculate the Compound interest.
Formula to calculate Compound interest is: P * (Math.pow(( 1 + R/100), T)
Where,
- P is Principal amount.
- R is rate of interest per annum.
- T is time in years.
Example:
Input:
P = 5000
R = 12
T = 5
Output:
Compound Interest = 8811.708416000003
Program to calculate Compound interest in Kotlin
Output
need an explanation for this answer? contact us directly to get an explanation for this answer