Write a C++ Program to Calculate Compound Interest

By | December 24, 2016

Calculate Compound Interest

Write a C++ Program to Calculate Compound Interest. Here’s simple Program to Calculate Compound Interest in C++ Programming Language.

What is compound interest?

It is the addition of interest to the principal sum of a loan or deposit, or in other words, interest on interest. It is the result of reinvesting interest, rather than paying it out, so that interest in the next period is then earned on the principal sum plus previously-accumulated interest.

It may be contrasted with simple interest, where interest is not added to the principal, so there is no compounding.

Annual compound interest formula

The formula for annual compound interest, including principal sum, is:

A = P (1 + r/n) (nt)


A = the future value of the investment/loan, including interest
P = the principal investment amount (the initial deposit or loan amount)
r = the annual interest rate (decimal)
n = the number of times that interest is compounded per year
t = the number of years the money is invested or borrowed for

Note that this formula gives you the future value of an investment or loan, which is compound interest plus the principal. Should you wish to calculate the compound interest only, you need this:

Total compounded interest = P (1 + r/n) (nt) – P

This program will read principal, rate and time in years and then print compound interest on entered principal for given time period.

Here is source code of the C++ Program to Calculate Compound Interest. The C++ program is successfully compiled and run(on Codeblocks) on a Windows system. The program output is also shown in below.



Above is the source code for C++ Program to Calculate Compound Interest which is successfully compiled and run on Windows System.The Output of the program is shown above .

If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach up to you in short interval.

Thanks for reading the post….

Leave a Reply