adplus-dvertising
frame-decoration

Question

Select the output for the following set of Code:
static void Main(string[] args)
  {
      int i, j;
      for (i = 2; i >= 0; i--)
      {
          for (j = 0; j <= 2; j++)
          {
              if (i == j)
              {
                  Console.WriteLine("1");
              }
              else
              {
                  Console.WriteLine("0");
              }
         }
         Console.WriteLine("\n");
         Console.ReadLine();
      }
  }

a.

1 0 0
0 1 0
0 0 1

b.

0 1 0
1 0 0
0 0 1

c.

0 0 1
0 1 0
1 0 0

d.

1 0 0
0 0 1
0 1 0

Posted under C# programming

Answer: (c).0 0 1
0 1 0
1 0 0

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: