program in python to calculate compound interest


Write a program in python to calculate compound interest.

import math
p=float(input("Enter the Principle Amount : "))
r=float(input("Enter the Rate : "))
t=float(input("Enter the rate : "))
amt=p*(math.pow((1+r/100),t))
ci=amt-p
print("Compound Interest is : ",ci)

Output:-

Enter the Principle Amount : 8000
Enter the Rate : 4.5
Enter the rate : 3

Compound Interest is :  1129.328999999998


Post a Comment

0 Comments