ObjectiveMcq
Print Protected
This page is protected for print. Use the website to view the content.
What will be the output of the following C++ code
#include <iostream>
#include <bitset>
using namespace std;
int main()
{
bitset<b1(95);
bitset<b2 = b1 >> cout<<b1<<endl<<b}
Correct Answer: B — 11111000
<< operator is used to shift bits towards left side so if we have 1111 then on shifting this by 2 i.e. 1111 << 2 will result into 1100.