In a two's complement number system, x &= (x-1) deletes the rightmost 1-bit in x. Explain why. Use this observation to write a faster version of bitcount.
Each input line holds an unsigned number in decimal. Print bitcount of it on a line of its own.
No submissions yet