Earn without any Investment!

Saturday, November 13, 2010

Calculating Simple interest

#include<iostream.h>
#include<conio.h>
class simple
{
 public:
  float p,r,si,amt;
  int n;
  void getin()
  {
    cout<<"Enter Principal Amt:";
    cin>>p;
    cout<<"Enter Intrest Rate :";
    cin>>r;
    cout<<"Enter No. of Years :";
    cin>>n;
    si=(p*n*r)/100;
    amt=p+si;
    cout<<"\n\t*-*-*-*\n";
    cout<<"   Intrest : Rs."<<si<<"\n";
    cout<<"   Amount  : Rs."<<amt;
  }
};
void main()
{
 clrscr();
 simple s;
 cout<<"*-*-*-*Calulate Simple Interest*-*-*-*\n\n";
 s.getin();
 getch();
}

No comments:

Post a Comment