Simple interest in Java

Source code :

public class SimpleInterest

{

    public static void main(String args[]) 

    {

        float p=100, r=70, t=60;

        float si;

        si = (r * t * p) / 100;

        System.out.print("The Simple Interest is : " + si);

    }

}

Output :

The Simple Interest is :4200

Algorithm :

  1. Initialize the variables
  2. Use the S.I formula (r * t * p) / 100
  3. Print the result

Output :


                

Comments :