You are on page 1of 1

#include<iostream>

using namespace std;


class volume
{
int side;
public:
volume()
{
side=0;
}
volume(int a)
{
side=a;
}

void takedata()
{
cout<<"enter side of the cube";
cin>>side;
}

void takedata(int);
void displaydata()
{
cout<<"\nside of the cube is"<<side;

}
void calvol()
{
int vol;
vol=side*side*side;
cout<<"\nvolume is"<<vol;
}
};
void volume::takedata(int s)
{
side=s;
}
int main()
{
int s;
volume v1;
volume v2;
v1.takedata();
v1.displaydata();
v1.calvol();
v2.takedata(3);
v2.displaydata();
v2.calvol();
volume v3(4);
volume v4=v3;
v4.displaydata();
v4.calvol();

return 0;

You might also like