Write a program that inputs principal amount ,rate of interest and time and calculates compound interest. [ p*(1+r)n-p]
Answers
Answered by
8
Answer:
import java.util.*;
class compound
{
public static void main(String args[ ] )
{
double p,r,t,ci;
Scanner sc=new Scanner(System.in);
System.out.println("Enter the Principal");
p=sc.nextDouble();
System.out.println("Enter the Rate of Interest");
r=sc.nextDouble();
System.out.println("Enter the Time");
t=sc.nextDouble();
ci=[p*Math.pow((1+r),n) - p];
System.out.println("Compound Interest" +ci);
}
}
Similar questions