adplus-dvertising
frame-decoration

Question

Select output for the following set of code :
static void Main(string[] args)
   {
       int const p = 0;
       switch (3 * 5 / 6)
       {
       case p: 
           Console.WriteLine("A");
           break;
       case p * 1:
           Console.WriteLine("B");
           break;
       case p - 2:
           Console.WriteLine("C");
           break;
       default: 
           Console.WriteLine("D");
       }
  }

a.

A

b.

B

c.

C

d.

Compile time error

Answer: (d).Compile time error

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Select output for the following set of code :