I'm making a simple program that displays the divisors of a number, and also adds the sum of all the divisors (not including the dividend)
Here's my for loop to find the divisors:
for(temp = 1; temp < n; temp++)
{
if(n % temp == 0)
{
cout << temp << endl;
}
}
My question is, how can I find the total of all the quotients? I know I need to have one more variable, but it's been awhile since I've programmed. Any tips? Thanks.
2007-01-26
02:37:03
·
1 answers
·
asked by
Defcon6
2
in
Computers & Internet
➔ Programming & Design