CSharp examples for Language Basics:for each
Using the foreach statement to loop through int array
using System;//from w w w.j a va 2 s .c o m public class ArrayListing { public static void Main( ) { int[] whole_numbers = {1,2,3,4,5,6,7,8,9,10}; foreach( int value in whole_numbers ) Console.WriteLine( "value = {0}", value ); } }