Xor profit problem

#include
using namespace std;

int main () {
int a,b;
cin>>a>>b;
int x=(a^a);
int y=(b^b);
int z=(a^b);
cout<<max(x,max(y,z))<<endl;
return 0;
}
test case not pass

hi @kumarakash121005
A simple solution is to generate all pairs, find their XOR values and finally return the maximum XOR value.
refer this code -->

what is wrong in my code

ur code makes no sense… a simple soln will be to generate all pairs and find max xor out of them…

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.