Computer Science, asked by sritanu330, 1 year ago

write a program to claculate the compound interest

Answers

Answered by shardul1925
0
import java.util.Scanner ;
public class Compound {
public static void main(String[]args) {
double p,n,r;
Scanner sc=new Scanner(System.in) ;
System.out.println("Enter Sum(Principal):");
p=sc.nextDouble();
System.out.println("Enter number of year:");
n=sc.nextDouble();
System.out.println("Enter rate :");
r=sc.nextDouble();
double a= p * Math.pow((1+(r/100)),n);
double c= a - p;
System.out.println("The compound interest
is " + c);
}

}





Hope it helps:(
Similar questions