The goto statement
Posted by Gizmosis350k
Last Updated: March 29, 2012
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 ^ ^
Related Content