Control Instructions

Q1:
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

E Compile error at label:.

ANS:A - Prints 1 to 9

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.