C++ Program To Calculate Compound Interest

What we are going to see through this article is we will see in detail C++ Program To Calculate 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.

formula:

CI = P * pow((1 + R / 100), T)

Where:

P = Principal Amount

T = Time

R = Rate

CI = Compound Interest

C++ Program To Calculate Compound Interest

C++ Program to Calculate Compound Interest

Compound Interest is an interest that obtains by adding the interest of each year to the principal sum and then calculating the interest on the updated amount.

#include<iostream>
#include<math.h>
 
using namespace std;
 
int main()
{
float p,r,t,ci;
cout<<"Enter Principle, Rate and Time:\n";
cin>>p>>r>>t;
ci=p*pow((1+r/100),t);
cout<<"\nCompound Interest = "<<ci;
 
return 0;
}

Output

Input p=1000, r=2, t=4

Enter Principle, Rate and Time:
1000
2
4

Compound Interest = 1082.43

Read Also: Convert Kilometers To Miles In C++

Final Words

What we learned through this article is to C++ Program To Calculate Compound Interest. Also if you have any doubts please leave a comment via the comment box. And we ask that you benefit everyone who shared this article with your friends.

Leave a Comment