- Aug 17, 2005
- 790
- 0
- 0
This is my second time asking for help again and I don't really like to but sometimes I just get stuck. If you guys could give me advice that would be great. So the program criteria is:
Write a program that prints all the perfect #'s less than 10,000.
A perfect # is one where the sum of its divisors is equal to the #, ex. 6=1 +2+3
this is what I got so far. I am just confused but i think what I got so far could be right.
int main (void) {
int i, j,SUM;
for (i=1;i<10000, i++)
for (j=1;j<i, j++)
{
}
if(i % j) == 0 {
SUM+= j
}
Write a program that prints all the perfect #'s less than 10,000.
A perfect # is one where the sum of its divisors is equal to the #, ex. 6=1 +2+3
this is what I got so far. I am just confused but i think what I got so far could be right.
int main (void) {
int i, j,SUM;
for (i=1;i<10000, i++)
for (j=1;j<i, j++)
{
}
if(i % j) == 0 {
SUM+= j
}