Hi guys I got a small problem for some reason I got an error on my sum. and however and where ever I put my int sum; it wont fix the error.
static void TotalOfEvenNegatives(int[] array)
{
for (int i = 0; i < array.Length; i++)
{
if (array[i] % 2 == 0 && array[i] < 0)
{
int sum;
sum += array[i];
}
}
}
return array.Where(x => x % 2 == 0 && x < 0).Sum();?