Count total bits in a number

Given a positive number, Our goal is to find number of bits which is present in given number.

 Number : 34  
 Output : 6
    [34 : 100010]
        |<------>|  = 6
 Number : 256
 Output : 9
   [255 : 100000000]
        |<--------->|  = 9 

Here given code implementation process.




Comment

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







© 2022, kalkicode.com, All rights reserved