title: C program to find if a number is palindrome or not
body: <p>I made a C program to check if a number is palindrome or not. I used the following code, but it shows numbers like 12321 as non palindrome. Can you please explain me the mistake in the program below? </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main()
  {
      int i, x, n, c, j;
      int d=0;
      printf ("enter total digits in number: ");
      scanf ("%d", &amp;i);
      printf ("\nenter number: ");
      scanf ("%d", &amp;n);
      j=n;
      for (x=1; x&lt;=i; x++)
      {
         c= j%10;
         d=c*(10^(i-x))+d;
         j=(j-c)/10;
      }
      if (d==n)
      {
          printf ("\npalindrome");
      }
      else
      {
          printf ("\nnon palindrome");
      }
      return 0;
  }
  </code></pre>