http://ideone.com/8zQFuz
#include "stdio.h"
#include "string.h"
int pall(int);
int main(int argc, char const *argv[])
{
int k,a,i,t;
scanf("%d",&t);
while(t)
{
scanf("%d",&k);
i=k+1;
while(1)
{
a=pall(i);
if (a==i)
{
printf("%d\n",i);
break;
}
i++;
}
t--;
}
return 0;
}
int pall(int x)
{
int y=0;
while(x!=0)
{
y=y*10;
y=y+(x%10);
x=x/10;
}
return y;
}
It says here "wrong answer"