Advertisement
obernardovieira

Prime numbers (Bitwise AND)

Aug 5th, 2014
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main() {
  4.     int n[8] = {1, 2, 3, 5, 8, 10, 14, 127};
  5.     for(int a=0; a!=8; a++) {
  6.         if(n[a] & 1) {
  7.             std::cout << "No" << std::endl;
  8.         }
  9.         else {
  10.             std::cout << "Yes" << std::endl;
  11.         }
  12.     }
  13.  
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement