why wrong answer?

#include<stdio.h>
//#include<conio.h>

int n,i,pal=0;

function(int x[])
{
// for(i=0;i<n;i++)
//{
chk(x[i]+1);
// }
}
chk(int m)
{
int no1=m-1,no;
if(pal==0)
{
no=m;
}
else
{
no=no1;
}
int temp,j,rev=0,rem;
temp=no;
while(temp!=0)
{
rem=temp%10;
rev=(rev*10)+rem;
temp=temp/10;
}
if(rev==no){
printf("%d\n",no);
}
else{
chk(no+1);
}
}
main()
{
scanf("%d",&n);
int a[n];
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
function(a);
}

//getch();
}

which problems solution is this? you should mention name or link of the problem before someone can help you out!!

@arpit123 : You are missing out that the number can have 1000000 digits.
Hint: Use an array to store all digits.