Write a program to enter principal, rate and time period. Calculate the simple interest and print the result
Answers
Answered by
2
Answer:
The answer
Explanation:
import java.util.*;
public class interest
{
public static void main [String args ()]
{
Scanner sc= new Scanner(System.in);
System.out.println("Enter the principal amount");
int p=sc.nextInt();
System.out.println("Enter the rate");
int r= sc.nextInt();
System.out.println("Enter the time in yrs");
int t= sc.nextInt();
int I = (p*r*t)/100;
System.out.println("The simple interest= "+ I);
}
}
Similar questions