Ticker

6/recent/ticker-posts

Header Ads Widget

Simple interest program using java

Simple interest program using java



Simple interest program




Simple Interest is the convenient method used in banking and economic sectors to calculate the interest charges on loans.It gets estimated day to day with the help of some mathematical terms.

Q) write a program to calculate simple interest.

Code:


import java.util.Scanner;
public class JavaExample
{
    public static void main(String args[]) 
    {
        float p, r, t, sinterest;
        Scanner scan = new Scanner(System.in);
        System.out.print("Enter the Principal : ");
        p = scan.nextFloat();
        System.out.print("Enter the Rate : ");
        r = scan.nextFloat();
        System.out.print("Enter the Time: ");
        t = scan.nextFloat();
        scan.close();
        sinterest = (p * r * t) / 100;        System.out.print("Simple Interest is: " +sinterest);
    }
}



Output:- 



Post a Comment

0 Comments