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