Our FREE site is mostly funded by the Amazon ads ⇓below⇓.
Support us by clicking ⇑above⇑ next time you plan to buy a product on Amazon.
int n, reversedInteger = 0, remainder, originalInteger;
printf("Enter an integer: ");
originalInteger = n;
// reversed integer is stored in variable
while( n!=0 )
remainder = n%10;
reversedInteger = reversedInteger*10 + remainder;
n /= 10;
// palindrome if orignalInteger and reversedInteger are equal
if (originalInteger == reversedInteger)
printf("%d is a palindrome.", originalInteger);
printf("%d is not a palindrome.", originalInteger);