📜  查找简单兴趣的程序

📅  最后修改于: 2021-04-29 03:24:01             🧑  作者: Mango

什么是“单利”?
单利是一种计算贷款利息费用的快速方法。单利是通过将每日利率乘以本金乘以两次付款之间经过的天数来确定的。
单利公式:

例子 :

EXAMPLE1:
Input : P = 10000
        R = 5
        T = 5
Output :2500
We need to find simple interest on 
Rs. 10,000 at the rate of 5% for 5 
units of time.

EXAMPLE2:
Input : P = 3000
        R = 7
        T = 1
Output :210

计算单利的公式为:simple_interest =(P * T * R)/ 100其中P是本金,T是时间,R是利率。

C++
// CPP program to find simple interest for
// given principal amount, time and rate of
// interest.
#include
using namespace std;
int main()
{
    // We can change values here for
    // different inputs
    float P = 1, R = 1, T = 1;
 
    /* Calculate simple interest */
    float SI = (P * T * R) / 100;
 
    /* Print the resultant value of SI */
    cout << "Simple Interest = " << SI;
 
    return 0;
}


Java
// A Simple 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.


Python3
# Python3 program to find simple interest
# for given principal amount, time and
# rate of interest.
 
# We can change values here for
# different inputs
P = 1
R = 1
T = 1
 
# Calculates simple interest
SI = (P * R * T) / 100
 
# Print the resultant value of SI
print("simple interest is", SI)
  
# This code is contributed by Azkia Anam.


C#
// A Simple C# program to compute
// simple interest for given principal
// amount, time and rate of interest.
using System;
 
class GFG {
     
    // Driver Code
    public static void Main()
    {
         
        // We can change values here for
        // different inputs
        float P = 1, R = 1, T = 1;
         
        // Calculate simple interest
        float SI = (P * T * R) / 100;
        Console.Write("Simple interest = "+ SI);
    }
}
 
// This code is contributed by Nitin Mittal.


PHP


Javascript


输出 :

Simple Interest : 0.01