Is it a power of 2?
Given a positive integer
n, your task is to find out if it’s a power of 2 or not.
In case it’s a power of 2, the program should print
Yes, and it should print
You can have an auxiliary variable
powerof2 = Trueand update it accordingly
Time limit: 1 seconds
Memory limit: 512 MB
Output limit: 1 MB