Giving Wrong answers

Didnt understand the error?

#include<bits/stdc++.h>
using namespace std;
int main(){
int x,y;
cin>>x;
cin>>y;
int max_xor=0;
for(int i=x,j=y;i<j;i++,j–){
int current=i^j;
if(current>max_xor){
max_xor=current;
}
}
cout<<max_xor;
}

it says, that you have given 2 number x & y, you have to find 2 numbers between these x & y number inclusive such that result of these 2 numbers is maximum.

1 Like

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.