#C13818. Find the Index of the First Even Number
Find the Index of the First Even Number
Find the Index of the First Even Number
You are given a list of integers. Your task is to find the index of the first even number in the list. The index is 0-based. If there is no even number in the list, output -1
.
For example, if the input list is [3, 7, 11, 14, 25, 32], the first even number is 14, which is at index 3.
inputFormat
The input begins with an integer n ($0 \leq n \leq 10^5$) on the first line, representing the number of integers. If n > 0, the second line contains n space-separated integers.
outputFormat
Output a single integer representing the 0-indexed position of the first even number in the list. If there is no even number, output -1
.
6
3 7 11 14 25 32
3
</p>