C++ Program to compute Compound interest and Simple Interest

This is a C++ program to calculate simple interest and compount interest from required data.
Compound and Simple interest calculated yearly.



Tested in Turbo C++.

I used the formula
                                    simple interest = (p*r*t)/100
                                    compound interest = p*(1+r/100)^t

lets start....

//start
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
float p,r,t,ci,si;
cout<<"Enter P , R & T(year)  :";
cin>>p>>r>>t;
si=(p*r*t)/100;
ci=p*pow((1+r/100),t)-p;
cout<<"Simple Intrest (calculated anually) is :"<<si;
cout<<"\n"<<"Compound intrest (compounded anually) is :"<<ci;
getch();
}
//end

                                                             OUTPUT::



Press          Alt+F9   to compile program.
Then Press Ctrl+F9  to run program.

If you need help ,comment below.

please share this blog to your friends

Subscribe us for Future posts (My C Plus Plus)
Thank you

About Author:

Hey Cyber Astronauts, Welcome to the one of best blog The CyberSpace HUB. I'm Himanshu Singh, a Part-time-blogger from India. Here at The CyberSpace HUB I write about Starting and managing a blog,Latest technology and Making Money online.


Join Me: Twitter | Facebook | Google Plus


EmoticonEmoticon