?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Moderate

Loops and Lists

APCSA-4XWKZ8

Consider the following:

ArrayList<Integer> list = new ArrayList<Integer>();
int count = 0;
list.add(13);
list.add(6);
list.add(7);
list.add(4);
list.add(10);
for (int i = 0; i < list.size(); i++)
 {
  if (list.get(i) % 2 == 1)
  count++;
 }

What is the value of count?

A

0

B

1

C

2

D

3

E

4