For Loop With Variable Increment
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
Question Leaderboard
Not enough data yet to show leaderboard.
APFIVE