adplus-dvertising
frame-decoration

Question

Select the output for the following code :
static void Main(string[] args)
  {
      switch (5)
      {
      case 5.0f: 
          Console.WriteLine("harsh");
          break;
      case 5: 
          Console.WriteLine("amish");
          break;
      case 5.0L: 
          Console.WriteLine("ANKIT");
          break;
      default:
          Console.WriteLine("ashish");
      }
      Console.ReadLine();
   }

a.

amish

b.

ANKIT

c.

harsh

d.

Compile time error

Posted under C# programming

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 the output for the following code :