Advertisement
montimaj

POWER OF 2

Apr 3rd, 2014
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.18 KB | None | 0 0
  1. #include<iostream>
  2. int main()
  3. {
  4.     int n;
  5.     std::cin>>n;
  6.     if(!(n&(n-1)))
  7.         std::cout<<"Power of 2"<<"\n";
  8.     else
  9.         std::cout<<"Not power of 2"<<"\n";
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement