Write a program that checks if the integer is a power of 2.
Use some sort of input stream to get the number (it is supposed to be typed). Input is not supposed to be initially stored in a variable.
The shortest code (in bytes) wins.
P.S. You can use any positive/negative response (for instance,
false). You may assume that input number is greater than
Thanks to you, guys, this question became very popular and got a bunch of different answers with interesting approaches, so I decided to append some info to make this thread readable. Code Golf is not only programming languages battle, it is also a challenge for different approaches within a single language. I decided to sum up interim results and note the leaders for every programming language for better navigation within the thread.
This table will be updated with new answers posted.