| preferred AP College board partner for AP classes
AP Computer Science A/Unit 5: Writing Classes
Start Practice TestPractice Test
About Exam
hard Solved by 3 students
For Loop With Post-Decrement Condition
< Prev
Next >

How many iterations does the for-loop execute in the code above?

public class LoopExample20 {
    public static void main(String[] args) {
        int count = 0;
        for (int i = 10; i-- > 5; ) {
            count++;
        }
        System.out.println(count);
    }
}
A

5

B

6

C

7

D

4

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