|Find the sum of even numbers in an array....|General Coding Problems

fn sum_even(nums: &[i32]) -> i32

Easy

Find the sum of even numbers in an array.

fn sum_even(nums: &[i32]) -> i32

Asked in

cognizant

Examples

Example 1:
Input: [1,2,3,4,5,6]
Output: 12
Example 2:
Input: [1,3,5,7]
Output: 0
Submit Result

Click Run to test sample cases, or Submit to evaluate all cases