Programming Languages C# Objective
Mar 08, 2013

What will be the output of the code 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;

}

Choose the correct answer:
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
Detailed Explanation

Option C is the right answer.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback