This is something that is explained in many books and such. Volunteers in forums such as this usually avoid answering questions such as this because there are so many great answers that already exist.
There are many techniques for designing programs. One is to use pseudo-code, which is nothing standard or well defined. Pseudo-code can be anything you want it to be if you are the only person using it. You can use pseudo-code to write a generalized draft version of your program. You can use whatever terminology you understand. Start by describing what you need to do at the topmost level which in this case is the main function. For example you might have:
Do 5 times
ask for math problem
say it is incorrect
Note that I have left out a couple of things, but that is just an example. After doing the top level as above, do each item (function) that needs more detail. Do that for each lower item. Then when you are ready, convert the pseudo-code to valid C++ code. By doing this (using pseudo-code) you can separate the overall program into peices that are easier to work with. You can use diagrams instead of narrative text if that helps you.