Bitwise operation

PHOTO EMBED

Wed Aug 03 2022 11:54:49 GMT+0000 (UTC)

Saved by @Ranjan_kumar #c++

#include<bits/stdc++.h>
using namespace std;
int main()
{
   int a=0b101;
   int b=0b10110;
   b<<=4;        //means b=101100000 shifting of b by 4
   int c=a|b;
   int d=a&b;
   int e=a^b;
   cout<<bitset<9>(c)<<"\n";
   cout<<bitset<9>(d)<<"\n";
   cout<<bitset<10>(e)<<"\n";
   return 0;
}
content_copyCOPY