Count Even and Odd Numbers
Easyjavapythonccppjavascript
Given an array of N integers, count how many elements are even and how many are odd.
Input Format
The first line contains an integer N. The second line contains N space-separated integers.
Output Format
Print two lines: Even = X Odd = Y where X is the count of even numbers and Y is the count of odd numbers.
Example 1
Input
5 2 7 4 9 6
Output
Even = 3 Odd = 2
Explanation: 2, 4, 6 are even and 7, 9 are odd.
- 1 <= N <= 100000
- -1000000000 <= A[i] <= 1000000000