#include <stdio.h>
// Function to check if a number is a palindrome int isPalindrome(int num) { int originalNum = num; int reverseNum = 0;
// Reversing the number
while (num > 0) {
int digit = num % 10;
reverseNum = reverseNum * 10 + digit;
num = num / 10;
}
// Checking if the original number is equal to the reversed number
if (originalNum == reverseNum) {
return 1; // Return 1 if palindrome
} else {
return 0; // Return 0 if not palindrome
}
}
int main() { int num;
// Input number from user
printf("Enter a number: ");
scanf("%d", &num);
// Check if the number is a palindrome
if (isPalindrome(num)) {
printf("%d is a palindrome number.\n", num);
} else {
printf("%d is not a palindrome number.\n", num);
}
return 0;
}