EXCLUSIVE OR (XOR) ^

This returns the logical exclusive OR of the two operands. If either operand (but not both) is true (non-0), the result is true(1); if both are true or both false(0), the result is false.

p = 0 ^ 0;

q = 1 ^ 0;

r = 0 ^ 1;

s = 1 ^ 1;

The values of p, q, r, and s are 0, 1, 1, 0 respectively.