using System; public class ForEachTest { static void Main(string[] args) { int[] array ={ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; int total = 0; foreach (int n in array) total += n; Console.WriteLine("Array total= " + total); } }