adplus-dvertising
frame-decoration

Question

Select the output for the following set of code :
static void Main(string[] args)
  {
      int i = 0, j = 0;
      while (i < 2)
      {
          l1: i--;
          while (j < 2)
          {
              Console.WriteLine("hi\n");
              goto l1;
          }
      }
      Console.ReadLine();
  }

a.

hi hi hi

b.

hi hi

c.

hi

d.

hi hi hi…..infinite times

Posted under C# programming

Answer: (d).hi hi hi…..infinite times

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 :