Report Bug

Qus: <p>What will be the output of the following expression?</p><pre><span style="font-size: 14px;">a = 2<br></span><span style="font-size: 14px;">b = 8<br></span><span style="font-size: 14px;">print(a|b )<br></span><span style="font-size: 14px;">print(a &gt;&gt; 1)</span></pre>

Qus<p>निम्नलिखित अभिव्यक्ति का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">a = 2<br></span><span style="font-size: 14px;">b = 8<br></span><span style="font-size: 14px;">print(a|b )<br></span><span style="font-size: 14px;">print(a &gt;&gt; 1)</span></pre>


A. 10 0
B. 10 2
C. 2 2
D. 10 1


Solution
D. 10 1



Explanation

binary of 2 is (10)

Binary of 8 is (1000)

Bitwise OR => (0010)|(1000) =>1010 => which is 10

binary of 2 is (10) 

and bitwise shift (01) which is 1 so the answer is 10 1

Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test , CCC MCQ Python Coding Tutorials Best Computer Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Website development Company in Allahabad