SWAPPING OF TWO NUMBER WITHOUT USING THIRD VARIABLE (XOR Bitwise operator)
SWAPPING OF TWO NUMBER WITHOUT USING THIRD VARIABLE (XOR Bitwise operator) with the use of XOR bitwise operator we can swap two number without using third variable XOR(^) : help to inverse the binary or decimal number ALGORITHM Take two variable a and b assign value of a and b (as we assign a=10 and b=15) then a = a^b ( value of a will change to 5 ) because a =10 =1 0 1 0 | only one bit should be 1 so b =15 = 1 1 1 1 | answer will be 1 or true a ^ b = 0 1 0 1 .i.e. 5 now b = a^b (here a = 5 and b = 15) then, value of b =10 because a =5 = 0 1 0 1 ...