Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript:
- function PowerOfTwo(n)
- {
- for(var I = 1; I < 32; I++)
- if(!(n ^ 0x01 << I))
- return true;
- return false;
- }
- var n = parseInt(prompt());
- alert(PowerOfTwo(n));
- void null;
Advertisement
Add Comment
Please, Sign In to add comment