Monday, 6 February 2017

Java program to find simple interest

import java.io.*;
public class SimpleInterest
{
public static void main(String []args)
  {
float p=100000,r=7.50f,t=5,SI,total; // p : principle amount, r = rate of interest, t : time period, SI : Simple interest, total : total amount paid in 5 years
SI=(p*r*t)/100;
total=c*t;

System.out.println(" SI is " + c);
System.out.println(" Total amount paid in 5 Years :" + total);
}
}



//javac SimpleInterest.java

//java SimpleInterest

Output :

SI is 37500.0

Total amount paid in 5 Years : 187500.0

No comments:

Post a Comment