TCS
Company
Programming
Basics
What happens when you perform a bitwise operation on these numbers? The result of the expression 4^12 is:
A)2 B)4 C)8 D)12
Read Solution (Total 3)
-
- ^ is the XOR operator. The binary form of 4 is 0100 and that of 12 is 1100. Therefore, 0010 ^ 1100 evaluates to 1000, which is equal to 8 in decimal format.
- 3 years agoHelpfull: Yes(2) No(0)
- c) 8
4 is 0100 and 12 is 1100 then when we perform 4^12 we get 8
XOR :
equal bits are set to 0 - 3 years agoHelpfull: Yes(1) No(0)
- D) 12
4 = 0100
12 = 1100
_OR)____________
= 1100
= 12 - 2 years agoHelpfull: Yes(0) No(1)
TCS Other Question