Xor profit problem

https://online.codingblocks.com/app/player/127473/content/109916/4977/code-challenge
https://ide.geeksforgeeks.org/PyOK5YZ1N2
code is giving correct output in ide but failing testcases

@anitagupta1411 either store a^b in var then compare or directly use max function - corrected


dont forget to hit like and mark resolved if cleared :smiley:

i am not able to see the corrected code can you copy and send it

@anitagupta1411 its in the link but here
#include
using namespace std;
int main () {
int x,y;
cin>>x>>y;
int mx=x^y;
for(int a=x;a<=y;a++){
for(int b=x;b<=y;b++){
mx=max(mx,a^b);
}
}
cout<<mx;
return 0;
}

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.