Created
February 20, 2017 19:48
-
-
Save janellbaxter/993b7f0608603737c5cc5b3baba53247 to your computer and use it in GitHub Desktop.
9.3 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 Lunch | |
{ | |
class Program | |
{ | |
static void Main() | |
{ | |
string[] lunch = new string[3]; | |
lunch[0] = "sandwich"; | |
lunch[1] = "drink"; | |
lunch[2] = "apple"; | |
for (int i = 0; i < lunch.Length; i++) | |
{ | |
Console.WriteLine("The value at " + i + " is " + lunch[i]); | |
} | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment