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
hard Solved by 2 students

For Loop With Variable Increment

Mark
< Prev
Next >

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

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

-1 1 4 8

B

-1 0 2 5

C

-1 0 3 7

D

0 1 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.

AI Tutor

How can I help?

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