Friday, January 10, 2014

Find Interest.

import java.util.Scanner;
class Interest
{
    public static void main(String args[])
    {
        Scanner n=new Scanner(System.in);
        System.out.print("Enter the Amount : ");
        float amt=n.nextFloat();
        System.out.print("Enter the Interest Rate : ");
        float rate=n.nextFloat();
        System.out.print("Enter the Year : ");
        float year=n.nextFloat();
        float i;
       
        i=(amt*rate*year)/100;
       
        System.out.println("Interest Is -->>: "+i);
    }
}

Output:

No comments:

Post a Comment