C Programming – Binary representation of a given number – Bit Algorithm – Write a program to print Binary representation of a given number.
Bit Algorithms:
Write a one line C function to return position of first 1 from right to left, in binary representation of an Integer.
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.
C Programming-Efficient way to multiply with 7 – Bit Algorithm-We can multiply a number by 7 using bit wise operator. First left shift the number by 3 bits.
Write a C program to find parity of an unsigned integer – Bit Algorithm – Parity of a number refers to whether it contains an odd or even number of 1-bit
C Programming-Write an Efficient Method Check if a Number is Multiple of 3 -If sum of digits in a number is multiple of 3 then number is multiple of 3 e.g.,You have to get all decimal digits one by one, add them and then check if sum is multiple of 3.
C Programming-Smallest power of 2 greater than or equal to n – Bit Algorithm – Write a function that, for a given no n, finds a number p which is greater
Count set bits in an integer in C Programming – Bit Algorithm – Simple Method Loop through all bits in an integer, check if bit is set and if then increment
C Program to Reverse Bits of a Number – Bit Algorithm – Given an unsigned integer, reverse all bits of it and return the number with reversed bits.
C Programming Check for Integer Overflow – Bit Algorithm – The solution of casting to long and adding to find detecting the overflow is not allowed.