 You can set more than one variable in a for-loops initialization and you can do more than one action after each iteration. You separate the initializers and actions with commas. I don't encourage you to write loops this way unless you know exactly what you're doing, but it does appear in books and you may see it in other people's code, so you should understand it. This code uses i and j as index variables because they have no inherent meaning. Let's trace through this loop and see what it does. The initializer sets both i and j to one. The continuation test asks if i is less than four. One is less than four, which means we print the values of i, j, and i plus j. The action after iteration adds one to i, making it two, and three to j, which makes it four. We come back to the test. Two is less than four, which means we print two, four, and two plus four. The action increases i to three and j to seven. i is still less than four, and we print i, j, and i plus j, three, seven, and ten. The action after iteration increases i to four and j to ten. When we come to the test this time, four is not less than four, and the four loop has concluded. If you aren't comfortable writing a loop this way, you can change it to an ordinary loop by taking one of the variables and initializing it outside the loop and doing the increment action at the end of the body of the loop. And that leaves you with a loop that has only one variable in the four specification.