Examveda

What will be the output of the following C# 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

Answer: Option D


Join The Discussion

Related Questions on Control Flow Statements in C Sharp