THE OUTPUT WOULD BE
#include<iostream.h>
#include<conio.h>
class simple
{ float p,r,t,s;
public:
void interest();
};
void simple::interest()
{ cout<<"Enter Amount: ";
cin>>p;
cout<<"Enter Rate: ";
cin>>r;
cout<<"Enter Time: ";
cin>>t;
s=(p*r*t)/100;
cout<<"Simple Interest="<<s;
}
void main()
{ clrscr();
simple obj;
obj.interest();
getch();
}
#include<iostream.h>
#include<conio.h>
class simple
{ float p,r,t,s;
public:
void interest();
};
void simple::interest()
{ cout<<"Enter Amount: ";
cin>>p;
cout<<"Enter Rate: ";
cin>>r;
cout<<"Enter Time: ";
cin>>t;
s=(p*r*t)/100;
cout<<"Simple Interest="<<s;
}
void main()
{ clrscr();
simple obj;
obj.interest();
getch();
}
No comments:
Post a Comment