Java Program to Calculate Simple Interest

Here you will get java program to calculate simple interest.

We can calculate simple interest in java by using following formula.

Simple Interest = (Principle x Rate x Time) / 100

Also Read: Java Program to Calculate Compound Interest

import java.util.Scanner;

public class JavaSimpleInterest {
	public static void main(String args[]){
		float p, r, t, si;
		Scanner sc = new Scanner(System.in);
		
		System.out.print("Enter principle: ");
		p = sc.nextFloat();
		
		System.out.print("Enter rate: ");
		r = sc.nextFloat();
		
		System.out.print("Enter time: ");
		t = sc.nextFloat();
		
		si = (p * r * t) / 100;
		
		System.out.print("\nSimple Interest = " + si);

	}
}

 

Output

Enter principle: 1000
Enter rate: 3
Enter time: 2

Simple Interest = 60.0

Leave a Comment

Your email address will not be published. Required fields are marked *