Created
February 20, 2017 19:42
-
-
Save janellbaxter/f9752fdd9b78daf6ab9231ae153033cb to your computer and use it in GitHub Desktop.
9.1 For Loops; Programming is Fun: C# Adventure Game (Learn C#)
This file contains 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
using System; | |
namespace Count | |
{ | |
class Program | |
{ | |
static void Main() | |
{ | |
Console.Title = "Examples of for loops"; | |
//increment | |
Console.WriteLine("Count 0 to 9!"); | |
for (int i = 0; i < 10; i++) | |
{ | |
Console.WriteLine(i); | |
} | |
//decrement | |
Console.WriteLine("Count down 9 to 0!"); | |
for (int j = 9; j > -1; j--) | |
{ | |
Console.WriteLine(j); | |
} | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment