Saturday 25 August 2012

C++

Program to Calculate Simple Interest and Compount Interest..........

#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
float p,r,t,si,c,ci;
cout<<"Enter Principle :"<<endl;
cin>>p;
cout<<"Enter Time Period :"<<endl;
cin>>t;
cout<<"Enter Rate of Interest :"<<endl;
cin>>r;
si=(p*r*t)/100;                                                   //formula for SI
c= pow ((((r/100)+1)*p),t);                               //formula for CI
ci = (c-p);
cout<<"Simple Interest : "<<si<<endl<<"Compound Interest : "<<ci<<endl;
getch();
}

No comments:

Post a Comment