Last active
November 29, 2017 10:39
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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