| preferred AP College board partner for AP classes
AP Computer Science A/Unit 4: Iteration
Start Practice TestPractice Test
About Exam
hard Solved by 2 students
For Loop With Variable Increment
< Prev
Next >

Consider the following code segment.

int incr = 1;
for (int i = 0; i < 10; i+= incr) 
{
    System.out.print(i - incr + " "); 
    incr++;
}

What is printed as a result of executing the code segment?

A

-1 0 2 5

B

-1 1 4 8

C

0 1 3 7

D

-1 0 3 7

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