C Programming
Computer Programming

Program in c to Check Whether a Number is Palindrome or Not



Write a Program in c to Check Whether a Number is Palindrome or Not

\* C Program to to Check Whether a Number is Palindrome or Not *\

# include < stdio.h >
int   main( )
{

int   num, rev=0, rem, temp  ;
printf(" Enter the Number : ") ;
scanf("%d ", & num) ;
temp = num ;
do
{

rem = num % 10 ;
rev = rev * 10 + rem ;
num = num / 10 ;

}
while (   num   >   0 )  ;
if (   temp == rev )
printf(" \n Entered Number is Palindrome !! ") ;
else
printf(" \n Entered Number is not a Palindrome !! ") ;
return ( 0 ) ;

}

Output of Program :

Output of Program in C to Check Whether a Number is Palindrome or Not