C Program Check Palindrome Number
#include <stdio.h> int main() { int n, reverseNum, lastDigit, num; printf("Enter a number : "); scanf("%d",&num); n = num; reverseNum = 0; while(n > 0) { lastDigit = n % 10; reverseNum = (reverseNum * 10) + lastDigit; n = n / 10; } if(num == reverseNum) printf("\n%d is a Palindrome number", num); else printf("\n%d is not a Palindrome number", num); return 0; }
OUTPUT
Enter a number : 525
525 is a Palindrome number
Output 2
Enter a number : 679
679 is not a Palindrome number