193030

Bitsets &

May 8th, 2020
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include<iostream>
  2. #include<bitset>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     bitset<3> a;
  8.     int x[] = {2,3,4};
  9.     int y[] = {2,3,2};
  10.     int res =0;
  11.     int total =0;
  12.     for(int i =0; i<3;i++)
  13.     {
  14.         a[i] = x[i] & y[i];
  15.         cout << a << endl;
  16.     }
  17.      cout <<a.count();
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment