A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/java/java-program-to-calculate-simple-interest/ below:

Java Program to Calculate Simple Interest

Java Program to Calculate Simple Interest

Last Updated : 23 Jul, 2025

Try it on GfG Practice

Simple interest is a quick method of calculating the interest charge on a loan. Simple interest is determined by multiplying the daily interest rate by the principal by the number of days that elapse between payments. 

Simple interest formula is given by:

Simple Interest = (P x T x R)/100 

Where, 

Examples: -

Example 1:

Input : P = 10000


R = 5
T = 5
Output : 2500

Explanation - We need to find simple interest on


Rs. 10, 000 at the rate of 5% for 5
units of time.

Example 2:

Input : P = 3000


R = 7
T = 1
Output : 210

Example 1:

Java
// Java program to compute
// simple interest for given principal
// amount, time and rate of interest.
import java.io.*;

class GFG {
    public static void main(String args[])
    {
        // We can change values here for
        // different inputs
        float P = 1, R = 1, T = 1;

        /* Calculate simple interest */
        float SI = (P * T * R) / 100;
        System.out.println("Simple interest = " + SI);
    }
}

// This code is contributed by Anant Agarwal.

Output
Simple interest = 0.01

Time Complexity: O(1)
Auxiliary Space: O(1)

Example 2:

Java
// Java program to compute
// simple interest for given principal
// amount, time and rate of interest.
import java.io.*;

class GFG {
    public static void main(String args[])
    {
        // We can change values here for
        // different inputs
        float P = 10000, R = 5, T = 5;

        // Calculate simple interest
        float SI = (P * T * R) / 100;
        System.out.println("Simple interest = " + SI);
    }
}

Output
Simple interest = 2500.0

Time Complexity: O(1)
Auxiliary Space: O(1)

Please refer complete article on the Program to find simple interest for more details!



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4