| preferred AP College board partner for AP classes
AP Computer Science A/Unit 4: Iteration
Start Practice TestPractice Test
About Exam
hard
Unconventional For Loop Logic
< Prev
Next >

What does the program print?

public class FaultyFor {
    public static void main(String[] args) {
        for (int i = 0; i < 3; i = i) {
            System.out.print(i + " ");
            if(i < -10) break;
            i--;
        }
        System.out.println("Finished");
    }
}
A

Infinite loop with no output

B

0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 Finished

C

0 -1 -2 Finished

D

0 Finished

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.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: [email protected]|Privacy Policy