Thursday, 17 October 2013

CPP Program to Calculate Simple Interest

//Write a program to calculate simple interest.
#include<iostream.h>
#include<conio.h>
void main()

{
clrscr();
int p,r,t,s;
cout<<”S i m p l e   I n t e r  e s t”<<endl<<endl;
cout<<”Enter the  rinciple amount : “;
cin>>p;
cout<<”Enter the rate of interest: “;
cin>>r;
cout<<”Enter the time in years   : “;
cin>>t;
s=(p*r*t)/100;
cout<<”Simple Interest           : “<<s;
cout<<endl<<endl<<”Press any Key to Exit….”;
getch();
}

Output:

No comments:

Comments System