 Here's a program that uses a for loop to calculate the sum of the squares of the integers from 0 up to 10. A for loop specifies three things. The initialization of the loop control variable. The loop condition. As long as this condition is true, we keep going through the loop. And the action to take after each iteration. In this case, we use the post increment plus plus operator to add one to the counter each time we go through the loop. The body of the for loop, the statements you want to repeat, are enclosed in a block after the for specification. You use braces to delimit the block. If the body of the loop consists of only one statement, you may omit the braces, but that's not a good idea. For consistency, and for the style guidelines for this course, you will always use braces no matter how many statements are in the body of the loop. For historical reasons, namely a language called FORTRAN, you will often see people using single letter variables like i, j, and k as counter variables rather than words like COUNT. Avoid single letter variables if you can give your loop counter a more meaningful name. Here's this code in a program that lets the user select the limit for the count. Let's run it to see that it does what we want. We'll enter a number like 10 and get the sum of squares. We can run it again and give another number like 75 and get that sum of squares. In this program, I started the loop counter at 1 because 0 times 0 doesn't change the sum. There's no law that says you have to start your counters at 0. There's no law that says a loop has to count upwards. In this case, the counter variable starts at 5, continues as long as the counter variable is greater than 0, and subtracts 1 as the action at the end of each iteration. There's also no law that says you have to count by 1. In this case, the action after each iteration adds 2 to the counter variable instead of 1. Notice that we've declared the loop counter variable inside the FOR specification. When you do this, the variable is considered local to the loop. That means you can't access the loop counter variable outside the loop. If you need to access the counter variable outside the loop, you'll also have to declare it outside the loop. Since you're initializing the variable outside the loop anyway, you can leave out the initialization step of the FOR specification, but you must keep the semicolon there. However, this is not a style that I would encourage. Instead, you'll usually declare the loop variable in the initialization step. The important thing to remember about a FOR loop is its three parts, the initialization, the loop continuation condition, and the action after each iteration.