How can we calculate whether a number is a power of 2 or not in a single statement without using a loop?
All the ones that I can think of use loops or don't satisfy the condition.
for eg.
The use of XOR doesn't work as it gives incorrect input.
or maybe I'm not using it in a proper manner.