Java program to find simple interest

Let’s learn java program to find simple interest.

Java program to find simple interest

Simple interest program in java is the one of the frequently asked question in interview.

Simple interest is used to enumerate interest on loan in banks. It is calculated by using formula,

Simple Interest = (P x R x T) / 100

P – is principal amount.

R – is rate per annum.

T – is time in years.

In the below simple interest program in java first user enters principal amount, rate and time in years using nextFloat() method of Scanner class.

These three values are stored in principal, rate and time variables of data type float.

Then find interest value in java using above formula.

Let’s see simple interest program in java.

import java.util.Scanner;
public class SimpleInterestJavaProgram
   public static void main(String[] args)
      float principal, rate, time;
      Scanner sc = new Scanner(;
      System.out.print("Enter principal amount : ");
      principal = sc.nextFloat();
      System.out.print("Please enter rate annually : ");
      rate = sc.nextFloat();
      System.out.print("Please enter time(in years) : ");
      time = sc.nextFloat();
      float simpleInterest;
      simpleInterest = (principal * time * rate) / 100;
      System.out.println("The Simple Interest is : " + simpleInterest);


java program to find simple interest

Also read – java reverse string array