adplus-dvertising
frame-decoration

Question

What will be the output of the code snippet given below?

int i;
for(i = 0; i<=10; i++)
{
    if(i == 4)
    {
        Console.Write(i + " "); continue;
    }
    else if (i != 4)
        Console.Write(i + " "); else
    break;
}

a.

1 2 3 4 5 6 7 8 9 10

b.

1 2 3 4

c.

0 1 2 3 4 5 6 7 8 9 10

d.

4 5 6 7 8 9 10

Posted under C# programming

Answer: (c).0 1 2 3 4 5 6 7 8 9 10

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the code snippet given below?