if(result == 0)
{
printf("%d\n", count); // if result is greater than 0 then number is not a prime number
}
}
}

return 0;
}

It only outputs 2 and 3 then ends. Please help me out.

02-29-2012

Adak

Step through your program with the debugger, and see what happens when the number being tested is 5 - that will show you.

I don't clearly understand what you were trying to do here. Looks like the mod test, but then -- well, it needs some print statements added to it with getchar()'s immediately afterward, to show you what's gone off the rails.