jae-l
5/31/2017 - 11:13 PM

Example of creating, initializing, and printing an array.

Example of creating, initializing, and printing an array.

string[] daysOfTheWeek = 
{
  "Monday", "Tuesday", "Wednesday","Thursday", "Friday", "Saturday", "Sunday" 
};

for (int i = 0; i < daysOfTheWeek.Length; i++)
{
  Console.WriteLine("Day {0}: {1}", i + 1, daysOfTheWeek[i]);
}

//  Day 1: Monday
//  Day 2: Tuesday
//  Day 3: Wednesday
//  Day 4: Thursday
//  Day 5: Friday
//  Day 6: Saturday
//  Day 7: Sunday