Created
November 29, 2017 10:38
-
-
Save luisdeol/527f4991228e1b3f90cb2bf8ad82141f to your computer and use it in GitHub Desktop.
Using the if and 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) | |
| { | |
| var coffee = true; | |
| var isDeadlineClose = false; | |
| if (coffee) | |
| { | |
| Console.WriteLine("Let's study for some additional hours!"); | |
| coffee = false; | |
| } | |
| if (coffee) | |
| { | |
| Console.WriteLine("There are still more coffee!"); | |
| } | |
| else if (isDeadlineClose) | |
| { | |
| coffee = true; | |
| Console.WriteLine("Let's study for some additional hours!"); | |
| } | |
| else | |
| { | |
| Console.WriteLine("It is time to sleep!"); | |
| var codeBlockVariable = "What's up?"; | |
| Console.WriteLine(codeBlockVariable); | |
| } | |
| // Console.WriteLine(codeBlockVariable); THROWS AN ERROR! | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment