C# - Print elements in the array
C# - Print elements in the array. Loop through the elements in the array and print one by one.
CODE
using System;
class Program
{
public static void Main()
{
int[] numbers = { 1, 2, 3, 4, 5, 6 };
for(int i = 0; i < numbers.Length; i++)
{
Console.Write(numbers[i] + " ");
}
Console.ReadKey();
}
}
Comments
Post a Comment