Net-informations.com
SiteMap  | About    

What is the use of goto statement in C#

The goto statement transfers the program control directly to a labeled statement. The goto requires a label of operation. You create label at anywhere in program then can pass the execution control via the goto statements . It can be used to exit a deeply nested loop.

Using goto in if statement

Example

Using goto in while loop

Example









net-informations.com (C) 2017    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.