1int[] nums = { 4, 8, 15, 16, 23, 42 };2int total = 0;3foreach (int n in nums)4{5 total += n;6}7Console.WriteLine(total);