I am getting a wrong asw for primes2 problem.Please help me.

#include<stdio.h>
#include<math.h>
int isprime(long int);
int main()
{
int count=0,i,a[305],j,f,pos=0;
long int n,no;
scanf("%ld",&n);
for(i=2;i<1000;i++)
{
if(isprime(i))
a[count++]=i;
}
while(a[pos++]<100);
//printf("%d\n",a[count-1]);
while(n)
{
f=0;
for(i=pos-2;i>=0;i–)
{
for(j=0;j<count;j++)
{
no=n-pow(a[i],3)-pow(a[j],2);
if(no<0)
break;
if(isprime(no))
{
printf("%ld %d %d\n",no,a[j],a[i]);
f=1;
break;
}
}
if(f)
break;
}
if(i==-1)
printf(“0 0 0\n”);
scanf("%ld",&n);
}
return 0;
}
int isprime(long int i)
{
int j,f=1;
if(i<=1)
return 0;
for(j=2;j<sqrt(i);j++)
{
if(i%j==0)
{
f=0;
break;
}
}
if(f)
return 1;
else
return 0;
}

//