C Binary Number With Alternating Bits Wrong Answer Stack Overflow

C Binary Number With Alternating Bits Wrong Answer Stack Overflow