AP Computer Science Amediummcq1 pt

The sum of int[] a = {2, 4, 6, 8} computed by an enhanced for loop is

A.20
B.18
C.24
D.8

Explanation

Core Concept

2 + 4 + 6 + 8 equals 20.

Correct Answer

A20

More Unit 6: Array practice questions

Try a random question →

Practice more AP Computer Science A questions with full explanations

Practice Unit 6: Array Questions →