Goto statement?
Demonstrate the typical use of goto statement?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted Nov 11, 2013, 8:28 PM EST
GOTO Statement transfers the program control directly to the labeled statement.
GOTO statement is also useful to get out of deeply nested loops.
Example
for(int i=0; i<=10;i++)
{
if(i==5)
{
goto forloopbreak;
}
}
forloopbreak:
Console.WriteLine("End");
hope this will help you.
VulpesRank #55 · 29.2K reputationPosted Nov 12, 2013, 12:06 AM EST
http://www.c-sharpcorner.com/UploadFile/b942f9/acceptable-uses-for-the-goto-statement-in-C-Sharp/