ExamVeda
Login
Home
Control Flow Statements in C Sharp
?

What will be the output of the following C# code?
static void Main(string[] args)
{
    int temp = 1;
    switch (temp << 2 + temp)
    {
    default: 
        Console.WriteLine("Example1");
        break;
    case 4: 
        Console.WriteLine("Example2");
        break;
    case 5: 
        Console.WriteLine("Example3");
        break;
    case 8: 
        Console.WriteLine("Example4");
        break;
    }
    Console.ReadLine();
}

Answer & Solution
Correct Answer: Option C
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.