when i try to do the following,
double root_value, c;
int d;
d=0;
printf("%.0f", root_value);
for(c=2; c<root_value;c++)
{
if(c !=root_value)
{
if(fmod(root_value,c)==0)
{
d = 1;
}
}
}
if(d == 1)
{
printf("not prime\n");
}
else
printf("is prime\n");
now its part of a program to determine if a number prime
using my data set of
11
24
2134213412
the program prints the origianl value then can process and correctly determine that 11 is prime and 24 is not prime by printing the corresponding message. however when it encounters the 10 digit number, it prints the number itself but never goes through the loop and prints the corresponding message.
any idea why it wont work?
it works with 6 digit numbers... double should hold more that that though