This program doesn't do much useful, either; it's just supposed to show you how loops work, and how loops can be nested. The outer loop runs i through the values 0, 1, and 2, and for each of these three values of i (that is, during each of the three trips through the outer loop) the inner loop runs, stepping the variable j through 5 values, 0 to 4.