using System;
using System.Collections.Generic;
using System.Text;
namespace ProgrammerDictionaryTutorialCode
{
public class ArrayUsageWithForEach
{
//Main entry point of the program
public static void Main()
{
/// <summary>
/// int[] Numbers = new int[] initializes the array
/// { } with the numbers 0-9 inside is the actuall elements of the array
/// </summary>
int[] Numbers = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
/// <summary>
/// A foreach statement will allow us to display the numbers sequentially
/// we declare that we will use an integer (int) a is a variable we will make up to use for this (in) Numbers. Numbers is our array name
foreach (int a in Numbers)
{
// We will write to the console for display a, which houses our Array, to display it as a string (words or letters)
Console.WriteLine(a.ToString());
}
// Debug so that the console will not exit immediately before we can see the results
Console.Read();
}
}
}
using System.Collections.Generic;
using System.Text;
namespace ProgrammerDictionaryTutorialCode
{
public class ArrayUsageWithForEach
{
//Main entry point of the program
public static void Main()
{
/// <summary>
/// int[] Numbers = new int[] initializes the array
/// { } with the numbers 0-9 inside is the actuall elements of the array
/// </summary>
int[] Numbers = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
/// <summary>
/// A foreach statement will allow us to display the numbers sequentially
/// we declare that we will use an integer (int) a is a variable we will make up to use for this (in) Numbers. Numbers is our array name
foreach (int a in Numbers)
{
// We will write to the console for display a, which houses our Array, to display it as a string (words or letters)
Console.WriteLine(a.ToString());
}
// Debug so that the console will not exit immediately before we can see the results
Console.Read();
}
}
}