Swap two numbers using XOR - no temporary variable needed!
The XOR swap trick uses the properties of XOR to swap without a temp variable:
Note: This only works when a and b are different variables. If a and b point to the same memory, both become 0!