Q15. bitmask output3
int a = 20, b = 2, c = 3, d = 1;
cout << ( a>>b&c+d ) << endl;
What will be the output of the above code?
5
2
4
11
Q15. bitmask output3
int a = 20, b = 2, c = 3, d = 1;
cout << ( a>>b&c+d ) << endl;
What will be the output of the above code?
5
2
4
11
Ans: 4
how
(a >> b ) & ( c+d)
(20 >>2 ) & ( 4)
10 & 4
-> 4