Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 4: Iteration
Start Practice TestPractice Test
About Exam
medium Solved by 2 students

For Loop With Continue Statement

Mark
< Prev
Next >

What is printed when the following code is executed?

public class ContinueTest {
    public static void main(String[] args) {
        int product = 1;
        for (int i = 1; i <= 5; i++) {
            if (i % 2 == 0) {
                continue;
            }
            product *= i;
        }
        System.out.println(product);
    }
}
A

15

B

60

C

5

D

8

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Not enough data yet to show leaderboard.

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy|