For Loops Answers 2
From CompSciWiki
int i = 0; int j = 0; int k = 2; for(i = 0; i < 100; i = i + 10) { j += (k * i); } System.out.println(j);
j = j + 0 = 0
j = j + 20 = 20
j = j + 40 = 60
j = j + 60 = 120
j = j + 80 = 200
j = j + 100 = 300
j = j + 120 = 420
j = j + 140 = 560
j = j + 160 = 720
j = j + 180 = 900
Note that there is no 200, since i = 100 makes (i < 100) false
So, all this means is 0+20+40+60+80+100+120+140+160+180 = 900