Write a program to check if a given number is a power of two.
MediumProblem Statement
Write a program to check if a given number is a power of two.
Sample Input
int n = 16;
Sample Output
16 is a power of 2.
Limits
Time: 2s · Memory: 256 MB
Write a program to check if a given number is a power of two.
int n = 16;
16 is a power of 2.
Time: 2s · Memory: 256 MB