Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following C# code?
bool a = true;
bool b = false;
a |= b;
Console.WriteLine(a);
Console.ReadLine();

What will be the output of the following C# code?
bool a = true;
bool b = false;
a |= b;
Console.WriteLine(a);
Console.ReadLine();
a) 0
b) 1
c) True
d) False

Answer: c
Explanation: ‘bools’ are single bits, and so a bit-wise OR is the same as a logical OR.

Join The Discussion