Dave thank u;
I think he has to use double because sqrt accept only double values(in my compiler using math.h)but it doesn't need using Floor...
in addition to points Dave mentioned I think if you change your testprime like below it could be better and faster..
Code:
int testprime(int c)
{
int a;//keeps sqrt of your number
a=sqrt((double)c);
int counter=2;
while(counter<=a)
{
if(c%counter==0) return 0;
counter++;
}
return 1;//if your number is prime it returns 1 otherwise 0
}
--------------------------------------------
Mehdi.:)