THE NEXT PALINDROME

Whats wrong with my code??
#include<stdio.h>
int main()
{
unsigned long int n,i,a[100],c[100],x,p,j,b[100],k,count,t;
scanf("%d",&t);
for(x=0;x<t;x++)
{
scanf("%d",&c[x]);
}
for(x=0;x<t;x++)
{
count=c[x]+1;
for(k=c[x]+1;k<=c[x]+10^10;k++)
{
c[x]=count++;
for(i=0;i<100;i++)
{
a[i]=c[x]%10;
c[x]=c[x]/10;
if(c[x]!=0)
continue;
break;
}
p=i;
for(j=0;j<=i;j++)
{
b[j]=a[p];
p–;

}
for(j=0;j<=i;j++)
{
	if(a[j]==b[j])
	continue;
	else
	break;
	
}
if(j!=i+1)
continue;
else
printf("%d\n",k);
break;

}
}
}

I am getting correct answer on my machine but here I am getting wrong answer. Where I am lagging??

@him_joshi13

You are using unsigned long int which can hold at most 18 or 19 digits (unsigned long long int )

Constraint is positive integer K of not more than 1000000 digits, so you are missing a lot of digits.