Answer to Question #274046 in C++ for Amit

Question #274046

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.


1
Expert's answer
2021-12-08T03:06:35-0500
class Greater {
public:
  void input(int x) {
    this.x=x;
  } 
  bool max(const Greater &other) {
    return x > other.x;
  }
private:
  int x;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment