निम्नलिखित छद्मकोड का आउटपुट क्या होगा, जहां ʌ XOR ऑपरेशन का प्रतिनिधित्व करता है?
What will be the output of the following pseudocode, where ʌ represent XOR operation ?
Integer a, b, c
Set b = 4, a = 3
c = a ^ b
Print c A
4
B
3
C
5
D
7
Explanation
Sure!
a = 3(binary0011) andb = 4(binary0100).- XOR (
^) gives1when bits are different,0when the same.
So, 3 ^ 4 = 7 (binary 0111).
Answer: (D) 7.
Correct Answer: D) 7