What does the following loop do? int[] a = {6, 1, 9, 5, 12, 3}; int len = a.length; int x = 0; for (int i = 0; i < len; i++)if (a[i] % 2 == 0) x++; system.out.println(x); 1. sums the even elements in a.2. finds the largest value in a.3. counts the even elements in a.4. finds the smallest value in a.

Solved
Show answers

Ask an AI advisor a question