Skip to content

Instantly share code, notes, and snippets.

@janellbaxter
Created February 20, 2017 19:46
Show Gist options
  • Save janellbaxter/682b1ff60c92b8c2952c5627b326e6d8 to your computer and use it in GitHub Desktop.
Save janellbaxter/682b1ff60c92b8c2952c5627b326e6d8 to your computer and use it in GitHub Desktop.
9.2 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";
for (int i = 0; i < lunch.Length; i++)
{
Console.WriteLine("The value at " + i + " is " + lunch[i]);
}
Console.WriteLine("The value of lunch.Length is: " + lunch.Length);
Console.ReadKey();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment