Write a program to find the compound Interest.
principle=float(input("Enter principle amount:"))
time=int(input("Enter time duration:"))
rate=float(input("Enter rate of interest:"))
amount = (principle * (1 + (float(rate)/100))**time)
compound_interest=amount-principle;
print("Compound interest:- ",compound_interest)
Answers
Answered by
2
Question:-
- Write a program to compute compound interest.
Code:-
class CI
{
public static void main(double p, double r, double t)
{
double A=p*Math.pow(1+r/100.0,t);
double CI=A-p;
System.out.println("Compound Interest is: "+CI);
}
}
Note:-
Compound Interest is calculated by using the formula,
Similar questions