right... Do you really want me to post my entire program here? Hundreds of lines of code just to fix one loop problem?
If you would have read more carefully, I did not say this in any way shape or form. I said a piece of code that reproduces your problem and compiles. In the code you provided only radius[] is unknown, so it wouldnt be too hard providing a very small example.
All he's telling you to do is make a complete and minimal example that demonstrates your problem instead of just code fragments. See : http://sscce.org/
Besides what's already been said, the recursion logic in your factor function seems to be wrong. Ex: Line 10 - you do nothing with the value returned by factor(x / num); call.
so could you. Are you going to continue to waste my time or are you going to help?
You're the one who wants other people to give up their time and energy in helping you. The responsibility is on you to do as much as possible to make it easy for us to help you. Not to sit there and complain that we're not jumping through enough hoops for you.