I need help with my perfect numbers program. I have it working how i need it to but it is not displaying the factors correctly. I need it to display the perfect number then the factors in a row following it and the way it sits now is it is putting the number and one factor after it then making more columns. any suggestions? here is my code.
You only need to move cout << sum << ":" << endl; outside the loop, and in the loop just print 'factors' separated by a space. When the loop ends put any number of newlines so that the next number is printed on its own line