Computer Science
Write a program to compute simple interest and compound interest.
Python
Python Funda
242 Likes
Answer
p = float(input("Enter principal: "))
r = float(input("Enter rate: "))
t = int(input("Enter time: "))
si = (p * r * t) / 100
ci = p * ((1 + (r / 100 ))** t) - p
print("Simple interest = ", si)
print("Compound interest = ", ci)
Output
Enter principal: 15217.75
Enter rate: 9.2
Enter time: 3
Simple interest = 4200.098999999999
Compound interest = 4598.357987312007
Answered By
132 Likes
Related Questions
Write a program to input a number and print its first five multiples.
Write a program to read details like name, class, age of a student and then print the details firstly in same line and then in separate lines. Make sure to have two blank lines in these two different types of prints.
Write a program to read a number n and print n2, n3 and n4.
Write a program to find area of a triangle.