Turning Learners Into Developers
Codekilla
CODEKILLA
Easy
CPP-001cpp

Count Even & Odd (Analytics)

Problem

Read n integers and print the count of evens and count of odds on a single line.

Input
Line 1: n. Line 2: n integers.
Output
`even odd` on one line.
Constraints
1 ≤ n ≤ 10^6, -10^9 ≤ a[i] ≤ 10^9
Sample input
6
1 2 3 4 5 6
Sample output
3 3
Explanation
Evens: 2,4,6 (3). Odds: 1,3,5 (3).
loopsconditionalsbasics@TCS@Infosys
Visible test cases
in: 6
1 2 3 4 5 6
out: 3 3
in: 1
2
out: 1 0
Your solution — run it, use AI if stuck
cpp