What will be the output of the following C# code?

static void Main(string[] args)
{
    int x;
    for (x = 1; x <= 3; x++)
    {
        int j = 1;
        do
        {
            j++;
        }while (x % j == 2);
        Console.WriteLine(x + " " + j);
    }
    Console.ReadLine();
}

a) 1 12 1 3 1
b) 1 12 13 1
c) 12 22 32
d) 11 21 31

1 thought on “What will be the output of the following C# code?”

Leave a Comment