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

Latest Current Affairs 2024 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad