What is the most elegant way to do the next stuff:
int i = oneOrZero; if (i == 0) { i = 1; } else { i = 0; }
You can assume that
i = ( i + 1 ) % 2, though I think we all agree the subtraction or xor method is better! (Though it has the added benefit of "flipping the switch" for more than binary.)
i = ( i + 1 ) % 2