Tuesday, 1 December 2020

Write a Program in Java to Calculate Simple Interest by taking input from the User.

import java.util.*;

class Simple_Interest

{

    public static void main(String args[])

    {

        Scanner in=new Scanner(System.in);

        double SI,P,R,T;

        System.out.println("Enter The Principal, Rate and Time");

        P=in.nextDouble();

        R=in.nextDouble();

        T=in.nextDouble();

        SI=(P*R*T)/100.0;

        System.out.println("The Simple Interest= "+SI);

    }

}

No comments:

Post a Comment

Java Program to count the total number of characters in a string

 //Java Program to count the total number of characters in a string import java.util.*; public class CountChars {     public static void mai...