Hi,
Just trying out some C on some of the project euler questions.
My question is why am I getting a floating point exception at run time on the following code?
#include <stdio.h>
main()
{
int sum;
int counter;
sum = 0;
counter = 0;
for (counter = 0; counter <= 1000; counter++)
{
if (1000 % counter == 0)
{
sum = sum + counter;
}
}
printf("Hello World");
printf("The answer should be %d", sum);
}
Thanks,
Mike