Programming Examples
Python program to calculate the compound interest
Write a program to Calculate the Compound Interest
Solution
import math
prin=float(input("Enter the Principal Amount : "))
rate=float(input("Enter the Rate : "))
time=float(input("Enter the Time (in year) : "))
amt=prin*(math.pow((1+rate/100),time))
ci=amt-prin
print("Compound Interest is",ci)
Output/ Explanation:
Enter the Principal Amount : 4000
Enter the Rate : 7.6
Enter the Time (in year) : 3
Compound Interest is 983.0679040000014