//https://csprograms4u.blogspot.com/
//Chapter 1
//Program 13
//Calculation of
Compound Interest
import
java.lang.Math;
import
java.util.Scanner;
public
class Compound_Interest
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
double a,p,r,t,ci;
System.out.println("Enter
Principle:");
p =sc.nextDouble();
System.out.println("Enter
Rate:");
r =sc.nextDouble();
System.out.println("Enter
Time:");
t =sc.nextDouble();
a=p*Math.pow((1+(r/100.0)),t);
ci=a-p;
System.out.println("Amount="+a);
System.out.println("Compound
Interest="+ci);
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.