#include #include class compare { int x,y; public: void getdata(void); int operator ==(compare &s); }; int compare::operator ==(compare &s) { if(x==s.x && y==s.y) return(1); else return(0); } void compare::getdata(void) { cout<<"\n Enter the value of x :"; cin>>x; cout<<"\n Enter the value of y :"; cin>>y; } void main() { clrscr(); compare i,j; i.getdata(); // Data given to first Object. j.getdata(); // Data given to second object. if (i==j) // Operator (==) overloaded. { cout<<"\n\n\t Both Objects are Equal"; } else cout<<"\n\n\t Both Objects are NOT Equal"; cout<<"\n\t Written By: Sujit Kr Nayak\n\t Roll No: ELD09006"; getch(); }