Demonstrate the use of the goto statement - CSharp Language Basics

CSharp examples for Language Basics:goto

Description

Demonstrate the use of the goto statement

Demo Code

using System;/*from   w  ww .j a  v  a2 s.c o m*/
public class GotoTest {
   public static void Main( ) {
      Console.WriteLine("about to goto label1");
      goto label1;
      Console.WriteLine("This will not print");
      label1:
      Console.WriteLine("label1 goto effective");
   }
}

Related Tutorials