I found your problem I think. Your algorithm is correct, but you have two redundant printf
s.
your primeloop
should be like this
int primeloop(int x,int y){
int num;
if ( x == 1 ) x++;
if(x <= y){
num = isPrime(x,2); // second input parameter added
if(num != 0){
printf("%5d ",x);
}
primeloop(x+1,y);
}
}