Program to add two number using bitwise operator

Algorithm : 
Suppose we need to add two bits.We can simply use Half adder logic.
In half adder sum of bits(S) is performed using bitwise XOR and carry of bits(C) is performed using bitwise AND.Now all we have to do is extend or further use the same logic for large number of bits.Bitwise XOR (^) of ‘a’ and ‘b’ gives the sum of ‘a’ and ‘b’ if ‘a’ and ‘b’ don’t have same bits at same positions.For example 2 ^ 3 will give you 1 while 2 ^ 5 will give 7.Now we can find carry using bitwise AND.All we need to calculate is (a & b) << 1 and then add it to a ^ b.This will be our desired answer.