#include<iostream>
#include<conio.h>
using namespace std;
class Shap
{
protected:
int height;
int width;
public:
void setWrth(int w);
void setHeight(int h);
};
class Print:public Shap
{
public:
int Find_Area();
};
void Shap::setWrth(int w)
{
width=w;
}
void Shap:: setHeight(int h)
{
height=h;
}
int Print::Find_Area()
{
return (width*height);
}
int main()
{
Print area;
int height,width;
cout << "Enter Width...";
cin >> width;
cout << "Enter Width...";
cin >> height;
area.setHeight(height);
area.setWrth(width);
cout << "Area Of the Triangle...."<< area.Find_Area()<< endl;
getch();
return 0;
}
#include<conio.h>
using namespace std;
class Shap
{
protected:
int height;
int width;
public:
void setWrth(int w);
void setHeight(int h);
};
class Print:public Shap
{
public:
int Find_Area();
};
void Shap::setWrth(int w)
{
width=w;
}
void Shap:: setHeight(int h)
{
height=h;
}
int Print::Find_Area()
{
return (width*height);
}
int main()
{
Print area;
int height,width;
cout << "Enter Width...";
cin >> width;
cout << "Enter Width...";
cin >> height;
area.setHeight(height);
area.setWrth(width);
cout << "Area Of the Triangle...."<< area.Find_Area()<< endl;
getch();
return 0;
}