C program to print the palindrome number program using while loop

C program to print the palindrome number program using while loop. This program will the result which is the element is palindrome or not in C. This program will show you whether the number is palindrome number or not a palidrome number

#include <stdio.h>
int main()
{
int num, rev=0, rem,temp;
printf("Enter an integer: ");
scanf("%d", &num);
temp=num;
while(temp!=0)
{
rem=temp%10;
rev=rev*10+rem;
temp/=10;
}
if(rev==num) 
printf("%d is palindrome number",num);
else
printf("%d is not palindrome number",num);
return 0;
}

Output

Enter an integer:

4545

4545 is not palindrome number