How to compare two integers using bitwise operator without using any comparative operator.

1)
int x = 10;
int y = 12;

int z = 0;

z = x ^ y;

If the value of z is 0 then the two integer is equal. If the value is not zero the two integer is not equal.

2)
function isEqual() {
return !(x-y)
}