Just out of curiosity, how can you tell if a number x is a power of two (x = 2^n) without using recursion.
Thanks
In a binary equivalent of any decimal number which is a power of two will have only one occurrence of 1 in its binary equivalent.