adplus-dvertising
frame-decoration

Question

Select the output for the following set of code :
static void Main(string[] args)
   {
       int i = 0;
       int j = 0;
       for (i = 0; i < 4; i++)
       {
           for (j = 0; j < 3; j++)
           {
               if (i > 1)
                   continue;
               Console.WriteLine("Hi \n");
           }
       }
       Console.ReadLine();
   }

a.

Prints hi 4 times

b.

Prints hi 3 times

c.

Prints hi 6 times

d.

Prints hi infinite times

Answer: (c).Prints hi 6 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 :