什么是“单利”? 单利是一种计算贷款利息的快速方法。单利是通过将每日利率乘以本金,再乘以付款间隔天数来确定的。 单利公式:
null
单利公式如下所示: 单利=(P x T x R)/100 哪里 P是基本量 这是时间和时间 R是利率
例如:
EXAMPLE1:Input : P = 10000 R = 5 T = 5Output :2500We 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 = 1Output :210
计算单利的公式是:单利=(P*T*R)/100,其中P是本金金额,T是时间,R是利率。
C++
// CPP program to find simple interest for // given principal amount, time and rate of // interest. #include<iostream> 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
<?php // PHP 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; /* Calculate simple interest */ $SI = ( $P * $T * $R ) / 100; /* Print the resultant value of SI */ echo "Simple Interest = " . $SI ; // This code is contributed by Sam007 ?> |
Javascript
<script> // JavaScript program to find simple interest for // given principal amount, time and rate of // interest. // We can change values here for // different inputs let P = 1, R = 1, T = 1; /* Calculate simple interest */ let SI = (P * T * R) / 100; /* Print the resultant value of SI */ document.write( "Simple Interest = " + SI); // This code is contributed by Surbhi Tyagi. </script> |
输出:
Simple Interest : 0.01
本文由 阿努拉格·拉瓦特 .如果你喜欢GeekSforgek,并想贡献自己的力量,你也可以使用 写极客。组织 或者把你的文章寄去评论-team@geeksforgeeks.org.看到你的文章出现在Geeksforgeks主页上,并帮助其他极客。 如果您发现任何不正确的地方,或者您想分享有关上述主题的更多信息,请写下评论。
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END