Possible Duplicate:
How to check if a number is a power of 2
This question has been asked in an interview.
How to check if a number is in 2^n
format {1, 2, 4, 8, 16, 32, ....}
without using *
, /
, +
, -
, %
operators?
And you can't use loops also.