So let's look at a straightforward use of the for statement, and we'll use a program similar to one we wrote for the while statement. In this program, we're going to try to count some of the characters and distinguish some of the characters in a file. Again later, we're going to use redirection. So I'm going to count blanks, and we'll actually apply this to this particular file. So anything that's a blank is something like that would be a blank right there, that would be a blank. We have a lot of blanks just because we like a good layout of the program. Now, we're going to count blanks, digits, total characters, and then again we're going to use the integer variable C to store the next character we select out of the file. Here's some interesting syntax for a for statement. We leave expression one empty. Expression one would be right there. So all you're seeing is a semicolon. When expression one is empty, there is no initialization. We don't need initialization because we've already initialized effectively. Total characters is what is going to be what's counted, and it's not going to be involved in determination. Determination is going to work in the same way as it did for the while statement; namely C calls this routine out of the standard IO library. That routine is a get character that normally returns all of the ascii values. However, this special value for the end of file normally defined as minus one. So as long as it doesn't see the end of the file, it doesn't exit. Then at the end of each loop on this, total characters would be incremented having started at zero. So we'll test for blank; here's a blank character, otherwise, we'll tests for digits, and we could do our tests if we did before. So I'll leave it up to you if you want to make this a more elaborate program. It wasn't necessary, but I did just because it makes it clearer. I made the singles, this one indeed a single statement. This is in if else single statement. So it would not need to be encapsulated as a compound statement, but sometimes that's just good practices. It make sure you're aligned. Notice that since there's an inner loop here, I use typically three spaces. So people use four or five and frequently they use the tab character, and they end and to show the level of flow of control. So the for statement is controlling the if statement, the if statement is controlling this sub statement that increments blanks, and the else if is controlling the sub statement that increments digits. When we exit the loop, namely when we achieve an end of file, then we can print out our totals. So let's show that this works. I'm going to say redirect the file that I just typed, which was I believe; if I've got this right, C4. Sure enough, there are 141 characters, 16 blanks, and total characters were 543. If you want, we can go back and look at that program, but it we said there were 16 digits, maybe we should just check that to make sure we didn't make a mistake. Okay, so there was one digit, two digits, three digits, four digits, five digits, six digits, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16. So indeed, our program seemed to have worked correctly. So I would suggest that you try and write this program for yourself and make it more elaborate.