Write a program to calculate simple and compound interest
Simple Interest = P * R * T / 100
Compound Interest = P * (1 + R/100*n)^n*t
Code
Principle = float(input("Enter Principle:"))Rate = float(input("Enter Rate:"))Time = float(input("Enter Time(n Years):"))Simple_interest = (Principle * Rate * Time) / 100Amount = Principle * (pow((1 + Rate / 100), Time))Compound_interest = Amount - Principleprint("Simple Interest:", Simple_interest)print("Compound Interest:", Compound_interest)
0 Comments
Post a Comment