dantehemerson
8/18/2018 - 8:57 AM

Check if j is ON__blog.cpp

#include <iostream>
using namespace std;

int main() {
  int S = 43;
  int j = 3;
  
  cout << ( S & ( 1 << j ) ) << endl;
  
  return 0;
}
#include <iostream>
using namespace std;

int main() {
  int S = 43;
  
  bool impar = S & 1;
  
  cout << "El numero " << S << " es" 
    << (impar ? " impar" : " par") << endl;
  
  return 0;
}