Given an int array nums, write a loop that prints out only the even elements of nums.
int
nums
For example, if nums is the array {8, 3, 4, 6, 7, 3, 2} your program should print 8, 4, 6, and 2.
{8, 3, 4, 6, 7, 3, 2}
8
4
6
2
For this problem we're expecting just a snippet of codeāso don't provide a method or class declaration.
Stuck? You may find these lessons helpful: