C Programming Check for Integer Overflow – Bit Algorithm – The solution of casting to long and adding to find detecting the overflow is not allowed.
unsigned int in c
3 Articles
3
Turn off the rightmost set bit – Bit Algorithm – Let the input number be n. n-1 would have all the bits flipped after the rightmost set bit .
Swap bits in a given number – Bit Algorithm – Given a number x and two positions (from right side) in binary representation of x, write a function that swap