Report Bug

Qus

What will be the output of the following expression?

a = 2
b = 8
print(a|b )
print(a >> 1)
Qus

निम्नलिखित अभिव्यक्ति का आउटपुट क्या होगा?

a = 2
b = 8
print(a|b )
print(a >> 1)


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

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz