I see you're really confused. These are the forums for Code::Blocks, which is a C/C++ IDE. These forums are in no way related to programming questions that don't involve Code::Blocks development itself.
It's true you will find many C/C++ programmers here, but we don't answer that kind of questions, at least not in these forums.
I suggest you to search for a C/C++ programming forum and post your question there.
Advice: due to the nature of your question (homework), try to do it yourself. Even people in a C/C++ programming forum won't feel like replying.
If you have any problem using Code::Blocks, feel free to come back and post your problem (only if you haven't found an answer using the search option in these forums). Just be sure it's related to Code::Blocks and people will try to help you.