Remember that the looping condition is evaluated immediately on entry into the loop, before the body of the loop has executed one time. Also remember not to put a semicolon after the closed parenthesis at the end of the loop because this immediately ends the loop.
Program 5.2 actually generates all the first 200 triangular numbers on its way to its final goal,
so it might be nice to generate a table of these numbers. To save space, however, let’s assume
that you want to print a table of just the first 10 triangular numbers. Program 5.3 performs this
task.