adplus-dvertising
frame-decoration

Question

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

Posted under C# programming

Answer: (a).1 2
2 1

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 :