adplus-dvertising
frame-decoration

Question

Select the output for the following set of code :
static void Main(string[] args)
   {
       int i = 10 , j = 0;
       label:
       i--;
       if ( i > 0)
       {
           Console.WriteLine(i+ " ");
           goto label;
       }
       Console.ReadLine();
   }

a.

1 2 3 4 5 6 7 8 9 10

b.

10 9 8 7 6 5 4 3 2 1 0

c.

9 8 7 6 5 4 3 2 1

d.

10 9 8 7 6 5 4 3 2 1

Answer: (c).9 8 7 6 5 4 3 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 :