It depends on how you have to display it.

As was stated, you are already finding factors, so storing the found factors in an array/vector for later display would be the route that I would take....