Examveda

What will be the output of the following C# code?
static void Main(string[] args)
{
    int i = 1, j;
    do
    {
        for (j = 1; ; j++)
        {
            if (j > 2)
                break;
            if (i == j)
                continue;
            Console.WriteLine(i + " " + j);
        }
        i++;
    } while (i < 3);
    Console.ReadLine();
}

A. 1 2
2 1

B. 2 1
1 2

C. 1 3
2 1

D. 1 1
2 1

Answer: Option A


Join The Discussion

Related Questions on Control Flow Statements in C Sharp