È stato utile?

Domanda

Program to find compound interest in C++

C++Server Side ProgrammingProgramming

In this tutorial, we will be discussing a program to find compound interest.

Compound interest is the interest by adding the current interest to the principal sum and then calculating the interest on the updated amount.

Example

 Live Demo

#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;
}

Output

Compound interest is 16288.9
raja
Published on 09-Sep-2020 14:47:09
Advertisements
È stato utile?
Non affiliato a Tutorialspoint
scroll top