Goto Tester
/* Learning C# by Jesse Liberty Publisher: O'Reilly ISBN: 0596003765 */ using System; public class GotoTester { public static void Main() { int counterVariable = 0; repeat: // the label Console.WriteLine( "counterVariable: {0}",counterVariable); // increment the counter counterVariable++; if (counterVariable < 10) goto repeat; // the dastardly deed } }
1. | Use goto with a switch | ||
2. | Demonstrate the goto | ||
3. | the goto statement |