NIELIT O Level Exam

What will the following code output? print(5 ^ 3)

What will the following code output? print(5 ^ 3)

निम्नलिखित कोड आउटपुट क्या होगा? print(5 ^ 3)

A. 6

B. 1

C. 2

D. Error एरर




Correct Answer is :

A. 6



Explanation
<p>uses the bitwise XOR (^) operator.</p><p>Convert numbers to binary:</p><p><br></p><p>5 → 0101</p><p><br></p><p>3 → 0011</p><p><br></p><p>Perform XOR operation:</p><p><br></p><p>^ 0011</p><p>= 0110</p><p>-------------</p><p>0110 in decimal = 6</p>
Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad