Find Compound Interest Program in C++

Advertisements

Prev Tutorial Next Tutorial

C++ Program to Find Compound Interest

Compound Interest is the addition of interest to the principal sum of a loan or deposit. in other word The concept of compound interest is that interest is added back to the principal sum so that interest is earned on that added interest during the next compounding period.

Compound Interest Example in C++

#include<iostream.h>
#include<conio.h>
#include<math.h>

void main()
{
   float p,r,i,t,ci,a;
   clrscr();

   cout<<"Enter Principal Amount : ";
   cin>>p;
   cout<<"Enter Interest Rate: ";
   cin>>r;
   cout<<"Enter time period in years: ";
   cin>>t;

   i=1+(r/100);

   // ci=pow(i,t);
   ci=1;
   for(a=1;a<=t;a++)
   ci=ci*i;

   ci=p*ci-p;

   cout<<"Compound interest is: "<<ci;

   getch();
}

Output 1

Enter Principal amount: 1000
Enter interest rate: 2
Enter time period in years: 1
Compound interest is : 20.00

Output 2

Enter Principal amount: 1000
Enter interest rate: 2
Enter time period in years: 2
Compound interest is : 40.40

Output 3

Enter Principal amount: 1000
Enter interest rate: 3
Enter time period in years: 4
Compound interest is : 125.51

Prev Tutorial Next Tutorial

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements