okay okay :cool:...so in the second loop I would call the function, no?
You really want us to write this for you, don't you.
The art of programming requires thought. I have not seen much thought on your part. It's just ask a question and hope you get the perfect answer.
The question you just asked is answered in the problem description you posted. Just as the previous question was. Now sit down with some paper and do the problem by hand so you understand how to solve the task. If you don't understand the problem, you can't program it. So work out how to solve the problem, then you have a better chance at programming it.