Skip to content

Instantly share code, notes, and snippets.

@janellbaxter
Created February 20, 2017 19:48
Show Gist options
  • Save janellbaxter/993b7f0608603737c5cc5b3baba53247 to your computer and use it in GitHub Desktop.
Save janellbaxter/993b7f0608603737c5cc5b3baba53247 to your computer and use it in GitHub Desktop.
9.3 For Loops; Programming is Fun: C# Adventure Game (Learn C#)
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