WAP to create a class Greater. Which have one private data member x. And member function input(),Max(). Find the greater no between two objects without using operator overloading.
class Greater {
public:
void input(int x) {
this.x=x;
}
bool max(const Greater &other) {
return x > other.x;
}
private:
int x;
}
Comments
Leave a comment