To sort three numbers you also have to compare and swap n1 and n2 again at the end. Example:
1 2 3
after first swap
2 1 3
after second swap
2 3 1
still not done
3 2 1
A bitwise operation modifies the bits of its operand directly. Such operations are fast, but primitive, which all processors support. Bitwise operations are faster than division, multiplication, and addition. However, they can only manipulate integral variables (such as int, short, and long). They are mainly used for comparison, shifting, and logical shifting.
See here for information on bitwise operations: http://www.lix.polytechnique.fr/~liberti/public/computing/prog/c/C/CONCEPT/bitwise.html