Programming Examples

Java program to input the Principal Rate and Time for a certain amount of money and print the Simple Interest


Write a program to input the Principal, Rate and Time for a certain amount of money and print the Simple Interest.

Solution

import java.util.*;
class SimpleInterest
{
	public static void main(String arr[])
	{
		Scanner sc=new Scanner(System.in);
		float p,r,t,si;
		System.out.println("Enter the principal:");
		p=sc.nextFloat();
		System.out.println("Enter the rate:");
		r=sc.nextFloat();
		System.out.println("Enter the time:");
		t=sc.nextFloat();
		si=(p*r*t)/100;
		System.out.println("Simple Interest="+si);
	}
}
Output

Enter the principal:

5000

Enter the rate:

7.3

Enter the time:

5

Simple Interest=1825.0

Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad