Given an array of int
s named nums
, construct an int
array named evens
that contains just the
even values from nums
. evens
should retain the ordering of elements from nums
.
For example, if nums
is the array {3, 22, 18, 44, 7, 9, 16}
, the array evens
should be
{22, 18, 44, 16}
.
nums
before declaring evens
.
Stuck? You may find these lessons helpful: