factors again - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

factors again

Hey thanks for your help.

I used your idea but i am a bit of a beginner at this C programming i have made changes in the code below but can't get it working.

Have i got the right idea...really struggling!!

Thanx again

Ant

#include
#include
long int y=1;
int max_fac = 0, x, factors;

main ()


{
for (x = 1; x <= 1000; x++) {
factors = 1;
for (y = 2; y <= x; y++)
if(x%y==0)



printf("%d, ", y);

if (factors > max_fac)


printf("%d
", x);

return 0;
}
}
Sign In or Register to comment.