Write a C program to check the inputed number is Palindrome or not.

#include <stdio.h>

int main() {
    int n=131, b=0, t=n; //change the value of n
    
    while(n){
       b=(b*10)+(n%10);
       n=n/10;
    }
    if (b==t){
       printf("%d is a palindrome number.", t);
    } else {
       printf("%d is not a palindrome number.", t);
    }
    
    return 0;
}

Comments