C# Programming - Operators - Discussion
Discussion Forum : Operators - General Questions (Q.No. 19)
19.
Which of the following statements is correct about Bitwise ^ operator used in C#.NET?
Discussion:
4 comments Page 1 of 1.
Caroline said:
1 decade ago
You will have to:
XOR 1 with 1 to invert it to 0 i.e. 1^1 = 0.
XOR 0 with 1 to invert it to 1 i.e. 0^1 = 1.
XOR 1 with 1 to invert it to 0 i.e. 1^1 = 0.
XOR 0 with 1 to invert it to 1 i.e. 0^1 = 1.
Johan braanen said:
1 decade ago
Xor can be used to set a bit off.
Xor is used in assembly: xor eax, eax which means eax = eax^eax=0.
Xor is used in assembly: xor eax, eax which means eax = eax^eax=0.
Salvi said:
1 decade ago
0^0 = 1.
1^0 = 0.
If both are same then only true.
i.e. only 0 can be used to invert.
1^0 = 0.
If both are same then only true.
i.e. only 0 can be used to invert.
Ddd said:
1 decade ago
@Salvi.
It's like this 0^0 = 0, 1^1 = 0.
1^0 = 1, 0^1 = 1.
It's like this 0^0 = 0, 1^1 = 0.
1^0 = 1, 0^1 = 1.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers