int[] a = {3, 1, 4, 1, 5, 9, 2, 6};
int sum = 0;
for (int x : a) sum += x;What is sum?
- A
29
- B
32
- C
30
- Dcheck_circle
31
Explanation
3+1+4+1+5+9+2+6 = 31.
AP Computer Science A· difficulty 1/5
int[] a = {3, 1, 4, 1, 5, 9, 2, 6};
int sum = 0;
for (int x : a) sum += x;What is sum?
29
32
30
31
Explanation
3+1+4+1+5+9+2+6 = 31.
Want 10 more like this — adaptive to your weak spots?