Answer the question
In order to leave comments, you need to log in
How do logical operators behave in complex situations?
I'm learning seasharp. There are problems :-(
That's what I understand.
Console.WriteLine(false & true); // false
Console.WriteLine(1 & 1); // 1
Console.WriteLine(-2 & -3); // -4
Console.WriteLine(2 & -2); // 2
Console.WriteLine(2 & 3); // 2
Answer the question
In order to leave comments, you need to log in
These are not exactly logical operators.
These are bitwise operators, and they perform operations on bits.
For example (in binary)
100 | 001 = 101
100 & 111 = 100
110 ^ 011 =
101
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question