I was doing Next Palindrome program. By looking at the problem statement,i have used [color=#4040FF]unsigned long long int[/color] to hold the value of variables in programme.The code successfully run on ideone website as well as on my gcc compiler. I dont understand on SPOJ why it is not running the further test cases and [color=#FF0000]what is wrong in my code?[/color] Please [color=#0000FF]guide[/color] me to improve my code so that it will get accepted on SPOJ. Thanks in advance.
#include<stdio.h>
int isPalindrome(unsigned long long no){
unsigned long long rev=0,temp=no;
while(no){
rev = rev*10 + no%10;
no = no / 10;
}
if(temp==rev)
return 1;
else return 0;
}
int main(){
unsigned long long int tc,number;
scanf("%llu",&tc);
while(tc--){
scanf("%llu",&number);
while(isPalindrome(++number)==0);
printf("%llu\n",number);
}
return 0;
}