#include<stdio.h>
#include<conio.h>
#include<math.h>
void primegen(int*, int*) ;
int main()
{
int t,i=0,c=0;
int store[10][10];
printf("No. of cases");
scanf("%d",&t);
if(t==0)
{ printf("enter valid data set");
}
if(t>=11)
{
printf("only 10 sets allowed");
}
if((t!=0)&&(t<11))
{
while(i<t)
{
printf("enter %d th dataset ", i);
scanf("%d %d", &store[i][0],&store[i][1]); //store input
i++ ;
}
while(c<t)
{
primegen(&store[c][0],&store[c][1]);
c++;
}
}
getch();
}
void primegen(int *p,int *q)
{ int i,j,k,c=0,cc;
int count;
printf("the data set elements are %d %d\n", *p, *q);
k=*p;
k++;
printf("initial k value %d\n",k);
printf("comparing\n");
printf("\n");
for(i=k;i<*q;i++)
{ // printf("comparing element %d \n", i);
for(j=2;j<i;j++)
{
if((i%j)==0)
{
}
else
{ c++;
}
}
cc=(i-2);
if(c==cc)
{
printf("%d is prime\n", i);
}
c=0;
}
printf("\n");
}
Ihave executed this code in Dev Cpp compiler 4.9 version. No compilation errors are shown, and the results obtained are also correct. But when I am submitting this same code here in spoj, compilation error is notified. Can't locate what compilation error is left. Please help me locate them.