Skip to content

Instantly share code, notes, and snippets.

@luisdeol
Last active November 29, 2017 10:39
Show Gist options
  • Save luisdeol/ea5b8cbf9f342851b0f35e5a0a1ac72a to your computer and use it in GitHub Desktop.
Save luisdeol/ea5b8cbf9f342851b0f35e5a0a1ac72a to your computer and use it in GitHub Desktop.
Use the GoTo statement to Jump to a specific part of the code
namespace implement_program_flow
{
class Program
{
static void Main(string[] args)
{
var toJump = true;
if (toJump)
goto myLabel;
Console.WriteLine("This is not going to be executed due to the goto statement!");
myLabel:
Console.WriteLine("Let's jump!");
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment