Java program to calculate Simple Interest

 import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        float p,n,r,si;

        Scanner s=new Scanner(System.in);

        System.out.println("Enter the amount:");

        p=s.nextInt();

        System.out.println("Enter the year");

        n=s.nextInt();

        System.out.println("Enter the rate of interst");

        r=s.nextInt();

        si=(p*n*r)/100;

        System.out.println("The simple intrest is:"+si);

    }

}


Comments

Popular Posts