If bit is not set in c then set it in second element to keep xor as zero for bit position
if ( ( c & ( 1 << bit ) ) == 0 ) { arr [ 1 ] |= ( 1 << bit ) ; } } } } int aa = int . MaxValue , bb = 0 , cc = 0 ;