Implement the method countEvenNumbers that returns how many even numbers are in an array.
Count how many even integers appear in an array. An even number is divisible by 2 with no remainder.
The task is designed to test careful handling of edge cases, not only the most common input.
- Use only the first
sizeelements. - Zero should be counted as even.
- The array may contain positive and negative values.
Loop through the requested range and increase the answer whenever value % 2 == 0.