Program/Source Code
Here is source code of the C program to reverse a number & checks it is a palindrome or not. The C program is successfully compiled and run on a Linux system. The program output is also shown below.
#include <stdio.h>
void main()
{
int num, temp, remainder, reverse = 0;
printf("Enter an integer \n");
scanf("%d", &num);
/* original number is stored at temp */
temp = num;
while (num > 0)
{
remainder = num % 10;
reverse = reverse * 10 + remainder;
num /= 10;
}
printf("Given number is = %d\n", temp);