This code is written by sagar dhakal.
for the educational purpose.....
#include <iostream>
using namespace std;
class box
{
private:
float l,b,area;
public:
void readdata()
{
cout<<"\t\t\t*****************************";
cout<<"\n\t\t\t\tWELCOME BY THE SAGAR DHAKAL\n\t\t\t_____________________________";
cout<<"\n\n\t\tTo find Area of Square and rectangle\n\n\t1.Enter the value of length\n---->";
cin>>l;
cout<<"\n\t2.Enter the value of breadth\n---->";
cin>>b;
}
void displayarea()
{
area=l*b;
cout<<"The area of the following object is:\n\t\t\t\t"<<area;
}
};
int main()
{
box b1;
b1.readdata();
b1.displayarea();
cout << "\n\t\tThank you!" << endl;
return 0;
}
No comments:
Post a Comment