Given a number, print the amount of
1s it has in binary representation.
>= 0 in base 10 that won't exceed the highest number your language is able to handle.
The amount of
1s in binary representation.
The shortest code wins.
- Bitwise operators. Other operators, like addition and multiplication, are allowed.
- Built-in base conversion functions.
Input: Ouput: 56432 8 Input: Output: 45781254 11 Input: Output: 0 0