Select the output for following set of code. [code] static void Main(string[] args) { int i = 2, j = 4; switch (i + j * 2)

Select the output for following set of code.
Code:
static void Main(string[] args)
{
    int i = 2, j = 4;
    switch (i + j * 2)
    {
        case 1 :
        case 2 :
            Console.WriteLine("1 and 2");
            break;
        case 3 to 10:
            Console.WriteLine("3 to 10");
            break;
    }
    Console.ReadLine();
}
A. 3 to 10 will be printed
B. 1 and 2 will be printed
C. error
D. The code gives output as 3 to 10
 

Tìm kiếm

Back
Top