Open In App

Java Program to Calculate Simple Interest

Last Updated : 26 Jul, 2024
Comments
Improve
Suggest changes
10 Likes
Like
Report

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, 

  • P is the principal amount 
  • T is the time and 
  • R is the rate

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:


Output
Simple interest = 0.01

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

Example 2:


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!


Next Article
Article Tags :
Practice Tags :

Similar Reads