title: SPOJ PALIN programe running successfully on ideone,but showing wrong answer when i am posting it on SPOJ
body: <p>A positive integer is called a palindrome if its representation in the decimal system is the same when read from left to right and from right to left. For a given positive integer K of not more than 1000000 digits, write the value of the smallest palindrome larger than K to output. Numbers are always displayed without leading zeros.</p>
  
  <p>Input</p>
  
  <p>The first line contains integer t, the number of test cases. Integers K are given in the next t lines.</p>
  
  <p>Output</p>
  
  <p>For each K, output the smallest palindrome larger than K.</p>
  
  <p>Example</p>
  
  <p>Input:
  2
  808
  2133</p>
  
  <p>Output:
  818
  2222</p>
  
  <p>My code which is working successfully on ideone but spoj shows "Wrong ans" ,can any one suggest me or correct me where i am wrong, here is my code;</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int ifPalindrome(int n){
       int r=0,k=0,a=n;
       while((a%10)!=0){
       r=a%10;
       k=10*k+r;
       a=a/10;
       }
    if(k==n)return 1;
  return 0;   
  }
  int main(){
      int t,n;
      scanf("%d",&amp;t);
  
      for(;t&gt;0;t--){
         scanf("%d",&amp;n);
         while(ifPalindrome(n)!=1){
          n++;
         }    
        if(ifPalindrome(n)==1)printf("%d\n",n);   
        }
        return 0;
    }
  </code></pre>