Skip to main content

Check if all bits of a number is active

If all the bits of a number are active, it means that every bit in the binary representation of the number is set to 1. In other words, the number has its maximum possible value in binary form.

Check whether all bits are set in given number

For example, if we consider an 7-bit binary number, all the bits of which are active, the binary representation would be 1111111. So result is "Yes". In other example decimal value of 13 are result is "no".

Code Solution


Please share your knowledge to improve code and content standard. Also submit your doubts, and test case. We improve by your feedback. We will try to resolve your query as soon as possible.

New Comment