Created
November 29, 2017 10:44
-
-
Save luisdeol/e8c4ca154ae2c4ab3f2a1b11acb69268 to your computer and use it in GitHub Desktop.
Using the Switch statement
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) | |
| { | |
| // The Switch Statemenet | |
| var rankingPosition = 1; | |
| switch (rankingPosition) | |
| { | |
| case 1: | |
| Console.WriteLine("Golden medal!"); | |
| goto case 2; | |
| case 2: | |
| Console.WriteLine("Silver medal!"); | |
| goto case 3; | |
| case 3: | |
| Console.WriteLine("Bronze medal!"); | |
| break; | |
| default: | |
| Console.WriteLine("Do not get sad! Let's strive to get prepared for the next contest!"); | |
| break; | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment