adplus-dvertising
frame-decoration

Question

What does the following C#.NET code snippet will print?

int i = 0, j = 0; 

label:
    i++;
    j+=i;
if (i < 10)
{
    Console.Write(i +" ");
    goto label; 
}

a.

Prints 1 to 9

b.

Prints 0 to 8

c.

Prints 2 to 8

d.

Prints 2 to 9

Answer: (a).Prints 1 to 9

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What does the following C#.NET code snippet will print?

Similar Questions

Discover Related MCQs