Assume array items contains the integer values 0, 2, 4, 6 and 8. Which of the following uses the enhanced for loop to display each value in array items?

a.
for (int i = 0; i < items.length; i++) {
System.out.prinf("%d%n", items[i]);
}
b.
for (int i : items) {
System.out.prinf("%d%n", items[i]);
}
c.
for (int i : items) {
System.out.prinf("%d%n", i);
}
d.
for (int i = 0 : items.length) {
System.out.prinf("%d%n", items[i]);
}

c.
for (int i : items) {
System.out.prinf("%d%n", i);
}

Computer Science & Information Technology

You might also like to view...

If you have to perform a repetitive task in Access, you may consider building a(n) ________ to automate the task

Fill in the blank(s) with correct word

Computer Science & Information Technology

________ are short lines that appear on an axis at regular intervals

A) Tick marks B) Data markers C) Degends D) Data points

Computer Science & Information Technology