Palindrome number check


Write a program to check whether the entered number is palindrome or not.

Palindrome numbers are those by reversing which you get the same number.
eg. 121,1331,12321,457754.


#include <stdio.h>
void main()
{
  int  n , rev=0 , r , temp ;
  printf("Enter a number: ") ;
  scanf("%d" , &n) ;
  temp = n ;
  temp=n ;
  while(n!=0)
  {
    r=n%10 ;    /* Extract the last digit */
    rev=rev*10+r ;  /* Find reverse */
    n=n/10 ;
  }

 if(rev == temp){
    printf("Entered number is palindrome");
 }
 else
     printf("Entered number is not palindrome");
}

Output :

Output