Monday, 2 March 2015

C++ Program To Find Compound Interest

Problem:- C++ Program To Find Compound Interest or compound interest program in c or c program for compound interest.

Logic:- According to Wikipedia Compound interest 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. Compound interest is standard in finance and economics.

Compound interest may be contrasted with simple interest, where interest is not added to the principal, so there is no compounding. The simple annual interest rate is the interest amount per period, multiplied by the number of periods per year. The simple annual interest rate is also known as the nominal interest rate.

Compound Interest Formula:-

CI = ( P * (pow((1+r/n),(n*t))) - P);


P = Principal amount .
r = Rate of nterest ( Annual ).
n = compounding frequency ( Monthly ).
t = time

Example:- We have 10,000 Rs is invested for in company rate of interest is 5%, and compounded monthly and for 15 years what will be the profit in principal amount, Explain with a step by step.


r = R / 100.

P = 10,000.
r = 5/100 = 0.05.
n = 12.
t = 15.

Now put these value in formula and after calculation remove the principal amount from compound interest so we can get total Compound Interest.

CI = ( 10,000 * (1 + 0.05 / 12 ) ^  ( 12 * 15 ) - 10,000 ).

So here we get final Compound interest earn is = 11137.2 Rs.


using namespace std;
int main()
 //By-Ghanendra Yadav

 float P, r, t, n, R, CI;
 cout<<"\n\nEnter The Principal Amount :\n";

 cout<<"\n\nEnter Rate of Interest (Annual) :\n";

 cout<<"\n\nEnter compounding frequency (Monthly) :\n";

 cout<<"\n\nEnter Time (Period) :\n";

 r = R / 100;

 CI = ( P * (pow((1+r/n),(n*t))) - P);

 cout<<"\n\nCompound Interest is After "<<t<<" Years is = "<<CI<<endl<<endl;

 return 0;



compound interest program in c

You May Like This:-

Ghanendra Yadav
Ghanendra Yadav

I Am Ghanendra Yadav Owner Of This Website. I Love Programming, Web Developing, Logo Making, Banner And Website designing. Currently I Am Studying In NIT Warangal And Also Working With WSDC( As Web Application Developer ) In NIT Warangal For Any Query Mail Me I Will Answer Within 24 Hours Email:-

Find me on Social Media

Facebook | Twitter | Google+ | RSS Feed

No comments:

Post a Comment