This isn't correct. Your code checks if the number is even - 0, 2, 4, 6, 8, 10, 12, 14, ... That's not the same as power of two, which is 1, 2, 4, 8, 16, 32, 64, ...
Ah, that's true, I missed that.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This isn't correct. Your code checks if the number is even - 0, 2, 4, 6, 8, 10, 12, 14, ... That's not the same as power of two, which is 1, 2, 4, 8, 16, 32, 64, ...
Ah, that's true, I missed that.