Question: how to find xor of two binary numbers?
Answer: The expression ((x | y) – (x & y)) is equivalent to x ^ y (finding XOR of two numbers x and y). XOR works by setting the bits which are set in either of one of the given numbers (0 ^ 1 = 1, 1 ^ 0 = 1) and finally taking out the common bits present in both numbers (1 ^ 1 = 0).