निम्नलिखित छद्म कोड का आउटपुट क्या होगा, जहां ʌ 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
4
B
3
C
5
D
7
Explanation
Sure! Here's a simple breakdown:
- a = 1 and b = 5.
- In binary:
a = 1→0001b = 5→0101
- XOR operation (
^):- Compare bits:
0001 ^ 0101 - Result:
0100(binary) 0100in decimal = 4
- Compare bits:
Answer:
(A) 4
Correct Answer: A) 4