Last active
April 23, 2017 18:19
-
-
Save patelmilanun/aba00575df69301521769a685ae34e52 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class coordinate | |
{ | |
private: | |
int x,y,z; | |
public: | |
void set() | |
{ | |
cout<<"Enter x:"<<endl; | |
cin>>x; | |
cout<<"Enter y:"<<endl; | |
cin>>y; | |
cout<<"Enter z:"<<endl; | |
cin>>z; | |
} | |
int operator ==(coordinate c) | |
{ | |
if(x==c.x && y==c.y && z==c.z) | |
return 1; | |
else | |
return 0; | |
} | |
}; | |
int main() { | |
// your code goes here | |
coordinate d,e; | |
d.set(); | |
e.set(); | |
if(d==e) | |
cout<<"Equal"; | |
else | |
cout<<"Not Equal"; | |
return 0; | |
} | |
=================output================================== | |
Enter x:1 | |
Enter y:3 | |
Enter z:2 | |
Enter x:1 | |
Enter y:2 | |
Enter z:3 | |
Not Equal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment