What is wrong with this code?
Can someone explain to me what am I doing wrong? I am trying to use "foreach" instead of a "for loop": using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { int[] numbers = new int[5]; int count = 0; while (count <5) { numbers[count] = Convert.ToInt32(Console.ReadLine()); count++; } //your code goes here foreach (int even in numbers) { if (even % 2 == 0) { count += even; } } Console.WriteLine(count); } } }