adplus-dvertising
frame-decoration

Question

Select the output for the following set of Code:
static void Main(string[] args)
 {
     int i;
     i = 0;
     while (i++ < 5)
     {
         Console.WriteLine(i);
     }
     Console.WriteLine("\n");
     i = 0;
     while ( ++i < 5)
    {
        Console.WriteLine(i);
    }
    Console.ReadLine();
}

a.

1 2 3 4
1 2 3 4 5

b.

1 2 3
1 2 3 4

c.

1 2 3 4 5
1 2 3 4

d.

1 2 3 4 5
1 2 3 4 5

Answer: (c).1 2 3 4 5
1 2 3 4

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: