The flow chart is filled in with these choices. It is mostly pseudo-code not specifically tied to C.
Try to get the loop correct before you make any other design decisions. If the loop is correct, you can think about what the loop body should do with each small piece of the problem.
Now think about the body of the loop. It should deal with just one character.
What should the loop body do?