Â
In this, we are going to write a program to find Simple Interest in Java.
import java.util.*;
class SimpleInterest
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
float p, r, t, si;
System.out.println("Enter the principal, rate and time");
p = sc.nextFloat();
r = sc.nextFloat();
t = sc.nextFloat();
si = ((p * r * t) / 100);
System.out.println("Simple Interest = " + si);
}
}
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP