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

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials 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 Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz