find the different bit: a ^ b

clean the least sifnificant bit(clean the leftmost 1):

c &(c-1)