निम्नलिखित छद्म कोड का आउटपुट क्या होगा, जहां ʌ XOR ऑपरेशन का प्रतिनिधित्व करते हैं?
What will be the output of the following pseudo code, where ʌ represent XOR operation ?
Integer a, b, c
Set b = 5, a = 1
c = a ^ b
Print c
A)
B)
C)
D)
Explanation:
Sure! Here's a simple breakdown:
- a = 1 and b = 5.
- In binary:
a = 1
→0001
b = 5
→0101
- XOR operation (
^
):- Compare bits:
0001 ^ 0101
- Result:
0100
(binary) 0100
in decimal = 4
- Compare bits:
Answer:
(A) 4