Binary Comparison in C++ Object Oriented Programming

#include<iostream>
using namespace std;
class hamza
{
private:
int a,b;
public:
hamza()
{
a=0;
   b=0;
}
hamza(int x,int y)
{
a=x;
a=y;
}
void get()
{
cin>>a;
cin>>b;
}

void show()
{
cout<<a<<endl;
cout<<b<<endl;
}
bool operator < (hamza) const;
};
bool hamza::operator < ( hamza h) const
{
int c=a+b;
    int d=h.a+h.b;
return (c<b) ? true : false;

}
int mainn()
{
hamza k,l;
k.get();
    l.get();
    k.show();
    l.show();
    if(k<l)
    cout<<"a is less then b";
    else
    cout<<"false";
    cout<<endl;
}
Binary Comparison in C++ Object Oriented Programming Binary Comparison in C++ Object Oriented Programming Reviewed by Hamza Bashir Ahmad on 06:22:00 Rating: 5