WAP to find simple interest using scanner.
3 years ago
OOP Java
Compile code:
import java.util.Scanner;
public class Si1{
public static void main(String args[]){
Scanner sc=new Scanner(System.in);
System.out.println("Enter a principal: ");
float p=sc.nextInt();
System.out.println("Enter a time: ");
float t=sc.nextInt();
System.out.println("Enter a rate: ");
float r=sc.nextInt();
sc.close();
float si=p*t*r/100;
System.out.println("The si of numbers: "+si);
}
}
Output:

Dipti KC
Jan 8, 2023