adplus-dvertising
frame-decoration

Question

Select the output for the following set of 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

Posted under C# programming

Answer: (c).12 22 32

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Select the output for the following set of code :