Report Bug

Qus

What will be the output of the following expression

x=14
print(x>>2)

Qus

निम्नलिखित एक्सपरशन का आउटपुट क्या होगा

x=14
print(x>>2)


A. 14
B. 1
C. 3
D. 2


Solution
C. 3



Explanation

hear >> bitwise right shift operator which perform the Right shift Operation:

x=14

in binary 14 is  1110

now when we shift 2 bits to the right then value become 0011

now 0011 is convert in decimal which is equivalent to 3, so the answer is 3

CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad