Sunday 16 August 2015

WAP in java to accept principal amount,rate of interest and year through the keyboard and find out simple interest.

//Calculate Simple Interest

import java.util.Scanner;

class SI {

public static void main(String args[])
{
Scanner sc=new Scanner(System.in);

System.out.println("Enter respectively principle,rate of interest(in %) and duration(in years):");
long p=sc.nextLong();
float r=sc.nextFloat();
float n=sc.nextFloat();

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

System.out.println("Simple Interest:"+si);
}

}

No comments:

Post a Comment