C Program to check whether a given integer number is palindrome or not
Program
#include<stdio.h>
void main()
{
int number, reverse, remainder, temp;
printf("Enter a integer number\n");
scanf("%d", &number);
temp = number;
while(number != 0)
{
remainder = number % 10;
reverse = reverse * 10 + remainder;
number = number/ 10;
}
if(temp == reverse)
printf("The given number is a palindrome\n");
else
printf("The given number is not a palindrome\n");
}
Output 1
Enter a integer number
8998
The given number is a palindrome
Output 2
Enter a integer number
3432
The given number is not a palindrome