Everyone, im kinda stuck on dis one problem. I have attempted it by nesting loops; however, i just can't get it mathematically. The problem is that i must make a program in C++ that finds the integer from 1 - 1000 with the most divsors tha produce no remainder. For example, the integer 60 has 12 divisors that produce no remainder. They are 1,2,3,4,5,6,10,12,15,20,30,60. Pleaze guys, i really need some help.
I had somethin like this
#include <iostream.h>
main()
{
long a,b,c;
for (a = 1; a <= 1000; a++)
{
for (b = 1; b <= 1000; b++)
{
c = a % b;
if (c == 0)
cout << a;
}
}
return 0;
}
Alex