Created
February 20, 2017 19:48
9.3 For Loops; Programming is Fun: C# Adventure Game (Learn C#)
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
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