What will be the output of the following C# code?
static void Main(string[] args)
{
byte b1 = 0 * AB;
byte b2 = 0 * 99;
byte temp;
temp = (byte) ~b2;
Console.Write( temp + " ");
temp = (byte) (b1 << b2);
Console.Write(temp + " ");
temp = (byte)(b2 >> 2);
Console.WriteLine(temp);
Console.ReadLine();
}
static void Main(string[] args)
{
byte b1 = 0 * AB;
byte b2 = 0 * 99;
byte temp;
temp = (byte) ~b2;
Console.Write( temp + " ");
temp = (byte) (b1 << b2);
Console.Write(temp + " ");
temp = (byte)(b2 >> 2);
Console.WriteLine(temp);
Console.ReadLine();
}
A. 101 0 34
B. 103 2 38
C. 102 0 38
D. 101 1 35
Answer: Option C
Related Questions on Operators and Expressions in C Sharp
What does the modulus operator (%) do in C#?
A. Increments the operand by 1
B. Returns the quotient of a division
C. Performs multiplication
D. Returns the remainder of a division
Join The Discussion