Home »
MCQs »
C# MCQs
What will be the output of the following C# code? | Question 8
39. What will be the output of the following C# code?
using System;
class Program {
static void Main(string[] args) {
Console.WriteLine(true ^ true);
}
}
- True
- False
- Error
- None
Answer: B) False
Explanation:
Here, we are using the Logical exclusive OR operator ^ (XOR). It returns true when one operand evaluates to true and another operand evaluates to false. In the above code, both of the operands are true. Thus, the output will be False.