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

uses the bitwise XOR (^) operator.

Convert numbers to binary:


5 → 0101


3 → 0011


Perform XOR operation:


^ 0011

= 0110

-------------

0110 in decimal = 6

Latest Current Affairs 2026 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