Subscribe Us

Responsive Advertisement

Advertisement

 

power of two using bit manipulation




#include<bits/stdc++.h>

using namespace std;

int main()

{

   int n;

   cin>>n;

   if((n&(n-1))==0)cout<<"power of two\n";

   else cout<<"Not power of two\n";


    return 0;

}


Post a Comment

0 Comments