The goto statement
Posted by Gizmosis350k
Last Updated: March 29, 2012
  2072

lol why me


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Chapter04Ex01._1
{
    class Program
    {
        static void Main(string[] args)
        {
        start:
            int myInteger = 5;
        goto addVal;
    writeResult:
        Console.WriteLine("myInteger = {0}", myInteger);
    goto start;
addVal:
    myInteger += 10;
goto writeResult;
        }
    }
}



...Still working on perfecting this, it's supposed to continuously print the value of myInteger + ten t the console ^ ^
   
  
 
 
   

 
 
The goto statement is not Recommended! Its causes spaghetti code......
 
Yea, i know won't be using it outside of my troll applications LoL

(do loop is better tho :x)