Python program to calculate simple interest and compound interest
Answers
Answered by
5
Coding:
p=int(input( "Enter principal:"))
r=int(input("Enter rate of interest:"))
t=int(input("Enter time:" ))
si=p*r*t/100
ci=(p*(1+r/100)**t)-p
print( "SI is ",si)
print(" CI is ",ci)
Output:
Enter principal:5000
Enter rate of interest:8
Enter time:2
SI is 800
CI is 832
Answered by
16
The following codes will have to be typed in script mode, saved and then executed.
CODE:
p = float(input("Enter the principal amount:"))
r = float(input("Enter the rate:"))
t = float(input("Enter the time period:"))
n = float(input("Enter the tenure of compoundings:"))
si = (p*r*t)/100
ci = p*(1+r/100)**n*t
print("The simple interest is:", si)
print("The compound interest is:", ci)
OUTPUT:
Attachments:
Similar questions
Math,
6 months ago
Math,
6 months ago
Math,
6 months ago
English,
1 year ago
Social Sciences,
1 year ago