Xor swap algorithm/Visual basic code
Appearance
The following Visual Basic subroutine swaps the values of its parameters using the xor operator.
Sub Swap (Var1 As Integer, Var2 As Integer) Var1 = Var1 Xor Var2 Var2 = Var2 Xor Var1 Var1 = Var1 Xor Var2 End Sub