Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> C++

Chương trình tính lãi suất kép trong C++


Tính lãi suất kép: A = P(1 + r/100)^t.

Ví dụ triển khai (C++)

#include <bits/stdc++.h>
using namespace std;

int main() {
    double P = 10000, r = 10.25, t = 5;
    double CI = P * pow(1 + r/100, t);
    cout << "Compound interest is " << CI;
    return 0;
}

Đầu ra

Compound interest is 16288.9