84.7k views
0 votes
What will this program print out? int function (int[] array) { for (int i = 0; i < 10; i++) { if (i % 2 == 0) { println(i); } } }

1) 2,4,6,8
2) 0,2,4,6,8,10
3) 2,3,4,5
4) 1,2,3,4
5) 0,2,4,6,8

User Rangoric
by
3.9k points

1 Answer

6 votes

Answer:

AP Comp sci amiright?

I believe the answer is 5.

User HolaJan
by
4.1k points