For loop getting little complex

for(int i = x;i<y;i++ && int j = y;j>x;j–){

m = (i^j);

if(m>k){
  k=m;
  
}

how to write this for(int i = x;i<y;i++ && int j = y;j>x;j–) correctly its giving error

for(int i=x, j=y; i<y && j>x; i++, j--) {
    m = (i^j);
    if(m>k) k=m;
}