Program is to find the area of room:
Program is to find the area of room with default values using classes & object
class room
{
private:
int len;
int wid;
int hei;
public:
int ar;
// function definitions
void assign()
{
len=20;
wid=30;
hei=40;
}
void area()
{
ar=2*(len*wid+wid*hei+hei*len);
}
void disp()
{
cout<<" length "<
cout<<" breadth "<
cout<<" height "<
cout<<" area "<
}
};
void main()
{
clrscr();
room area1;
area1.assign();
area1.area();
area1.disp();
}