Skip to content
CampusEduX

Count Set Bits

Easyjavapythonccppjavascript

Given a non-negative integer N, count how many 1 bits are present in its binary representation.

Input Format

A single line containing the integer N.

Output Format

Print the number of set bits.

Related Problems

  • Check Odd or Even Using Bits
    Easy · java, python, c, cpp, javascript
    Solve Problem
  • Find the Missing Number Using XOR
    Easy · java, python, c, cpp, javascript
    Solve Problem

Input (stdin)

Output

Run your code to see output here...