பின்வரும் நிரலின் வெளியிட்டை எழுதுக
#include < iostream >
using namespace std;
class Container {
public:
// Constructor definition
Container(double 1 = 2.C, double b = 2.0, double h= 2.0) {
cout << "Constructor called." ,<< end1;
length = 1;
breadth = b;
height = h;
}
double Volume ( ) {
return length * breadth * height;
}
int compare(Container container)
{
return this->VolumeO »Container.volumet):
}
private:
double length; // Length of a Container
double breadth; // Breadth of a Container
double height; // Height of a Container
} ;
int main(void) {
Container Container1(3.3, 1.2, 1.5); II Declare
Container!
Container Container2(8.5, 6.0, 2.0); II Declare
Container2
if(Container l.compare(Container2)) {
cout << "Container2 is smaller than Container1"
<< end1;
} else {
cout << "Container2 is equal to or larger than
Container1'' << endl;
}
return 0;
}