Check whether given number is Power of 2 using bitwise operators in C
Problem : Check whether given number is power of 2 using bitwise operators in C Algorithm : Let us see the binary representation of numbers which are power of 2: As we can see in above example,any number which is power of 2 has only 1 bit set. Now let us subtract 1 from above … Read more