Examveda

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();
}

A. 101 0 34

B. 103 2 38

C. 102 0 38

D. 101 1 35

Answer: Option C


Join The Discussion

Related Questions on Operators and Expressions in C Sharp