Skip to content

Instantly share code, notes, and snippets.

@janellbaxter
Last active February 22, 2017 19:01
Show Gist options
  • Save janellbaxter/9d08f5e1ab62f9a7ad9d3898a1534606 to your computer and use it in GitHub Desktop.
Save janellbaxter/9d08f5e1ab62f9a7ad9d3898a1534606 to your computer and use it in GitHub Desktop.
9.4 For Each; Programming is Fun: C# Adventure Game (Learn C#)
/*
* [Your Title]
* by Your Name, Date
*
* This work is a derivative of
* "C# Adventure Game" by http://programmingisfun.com, used under CC BY.
* https://creativecommons.org/licenses/by/4.0/
*/
using System;
namespace GroceryList
{
class Program
{
static void Main()
{
Console.Title = "Write Each Element in Array";
string[] items = {
"banana",
"orange",
"avocado",
"pretzels",
"lemon",
"pecans"
};
foreach (string element in items)
{
Console.WriteLine(element);
}
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment