DSA/algorithms/CPlusPlus/Bit manupulation/power_of_two.cpp

13 lines
169 B
C++

#include<bits/stdc++.h>
using namespace std;
int check2power(int n){
return ((n & (n-1))==0);
}
int main(){
int n;
cin>>n;
cout<<check2power(n);
}