simple interest in java
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// simple interest
Scanner scanner = new Scanner(System.in);
System.out.print("Enter principal amount: ");
float principal = scanner.nextFloat();
System.out.print("Enter time in years: ");
float time = scanner.nextFloat();
System.out.print("Enter rate: ");
float rate = scanner.nextFloat();
float simpleInterest = (principal * time * rate) / 100;
System.out.println("The simple interest is " + simpleInterest);
}
}