Code:
if (isprime(i) && count%10!=0) {
printf("%d\t",i);
count++;
}
if (isprime(i) && count%10==0) {
printf("%d\n",i);
count++;
}
You need braces around those statements. Without them, only the printfs get put inside the if block, and you do count++ twice per loop. Considering you start count at 1, you then go to 3, 5, 7, 9, 11, etc, skipping every multiple of 10. A better solution would be to keep common code out of the if statements, and to use an else instead of you strange two-if setup:
Code:
if (isprime(i)) {
if (count % 10) { // count is not a multiple of 10, print a tab
printf("%d\t", i);
}
else { // count is a multiple of 10, print a new line
printf("%d\n", i);
}
count++; // only increment count once
}