This code is showing results for large numbers also.Still i am getting tle.
#include <stdio.h>
#include <conio.h>
int main(void)
{
int a,rev=0,dig,b,i,count=0;
scanf("%d",&b);
while(1)
{ rev=0;
a=b;
while(a!=0)
{
dig=a%10;
rev=(rev*10)+dig;
a=a/10;
}
if(rev==b){
for(i=1;i<=b;i++)
{
if(b%i==0){count++;}
}
if(count==2){break;}
}
count=0;
b++;
}
printf("%d",b);
getch();
return 0;
}