Program to find compound interest in C++


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

Updated on: 09-Sep-2020

192 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements