Home / Engineering / Problem Solving and Python Programming / Question

M

Mr. Dubey • 51.17K Points
Coach

Q.) What will be the output of the following
Python expression?
4^12

(A) 2
(B) 4
(C) 8
(D) 12
Correct answer : Option (A) - 2

Explanation:
 ^ is the xor operator. the binary form of 4 is 0100 and that of 12 is 1100. therefore, 0100^1100 is 1000, which is equal to 8.

Share

Discusssion

Login to discuss.