You are viewing a single comment's thread. Return to all comments →
It may help you!!
class Box { public: int l,b,h; Box() { l=0; b=0; h=0; } Box(int length, int breadth, int height) { l=length; b=breadth; h=height; } Box(Box &B) { l = B.l; b = B.b; h = B.h; } int getLength() { return l; } int getBreadth() { return b; } int getHeight() { return h; } long long CalculateVolume() { return (l*b*h); } bool operator<(const Box& B) { if (l < B.l) return true; if (b < B.b && l == B.l) return true; if (h < B.h && l == B.l && b == B.b) return true; return false; } }; ostream& operator<<(ostream& out, const Box& B) { out << B.l << " " << B.b << " " << B.h; return out; }
Box It!
You are viewing a single comment's thread. Return to all comments →
It may help you!!