Skip to main content

Java Topic Practice

For Loops

For Loops MCQ Practice

Question 1 of 15

Answered 0 of 15

Choose one answer.

What is printed by the following code segment?

int total = 0;
for (int i = 1; i <= 5; i += 2) {
  total += i + 2;
}
System.out.print(total);
Choose one answer.