Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 361 Bytes

File metadata and controls

19 lines (13 loc) · 361 Bytes

Number of Ones

Task:

Count the number of ones in the binary representation of a given integer.

Input Format:

An integer.

Output Format:

An integer representing the count of ones in the binary representation of the input.

Sample Input:

9

Sample Output:

2

Explanation:

The binary representation of 9 is 1001, which includes 2 ones.