What is the output of the following C# code snippet?

class Demo
{
    public static void Main()
    {
        int x = 10;
        switch (x)
        {
            case 1:
                Console.WriteLine("One");
                break;
            case 2:
                Console.WriteLine("Two");
                break;
            default:
                Console.WriteLine("All");
        }
    }
}

 

All
All One Two
Compilation Error: Control cannot fall through
Verified Answer
Correct Option - c

To get all Infosys Certified CSharp Programmer Exam questions Join Telegram Group https://bit.ly/infy_premium_group

Telegram

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in

Updated on Tue, 1 Jul 2025