C Programming Find position of the only set bit – Given a number having only one ‘1’ and all other ’0’s in its binary representation.
powers of 2
5 Articles
5
C Program to find whether a no is power of two – Bit Algorithm – Given a positive integer, write a function to find if it is a power of two or not.
Compute modulus division by a power of 2 number – Bit Algorithm – operators, where d is a power of 2 number.Let it bit from right is set in d. For getting n
Find whether a given number is a power of 4 or not – Bit Algorithm – A simple method is to take log of the given number on base 4, and if we get an integer.
Program to count number of set bits in an (big) array- Bit Algorithm – The simple approach would be, create an efficient method to count set bits in a word.