Sometimes it is use the for-loop on your arrays. the for loop is a very popular and useful loop construct.you will need to cast the element after using its index.You can find more separate information on indexers here.
namespace demo_array { class Program { static void Main(string[] args) { int[] array = { 100, 300, 500, 700, 900, 1000 }; // Use for loop. for (int i = 0; i < array.Length; i++) { Console.WriteLine(array[i]); } Console.ReadKey(); } } }
Output
Ask Your Question