C++ 中查詢複合利息的程式


本教程將介紹一個用於查詢複合利息的程式。

複合利息是將當前利息新增到本金中,然後計算更新後的金額的利息。

示例

 線上演示

#include <bits/stdc++.h>
using namespace std;
int main(){
   double principle = 10000, rate = 10.25, time = 5;
   //calculating compound interest
   double CI = principle * (pow((1 + rate / 100), time));
   cout << "Compound interest is " << CI;
   return 0;
}

輸出

Compound interest is 16288.9

更新於: 2020 年 9 月 9 日

266 次瀏覽

開啟你的 職業 生涯

完成課程,獲得認證

開始
廣告
© . All rights reserved.