Count the even numbers
The first number is n. Then n whole numbers follow. Print how many of them are even.
Input
5 1 2 3 4 6
Expected output
3
Input
3 1 3 5
Expected output
0
Show a hint
Read the numbers one at a time inside a loop that runs n times.
Show a solution
Loading the editor…
Run the tests to check your solution.