This is a C program which checks whether a number is palindrome or not .
Generally a number is said to be a palindrome number if its reverse is same as the original number .
For Example : 121 is a palindrome as its reverse is also 121 where as , 231 is not a palindrome as its reverse is 132 .
PROGRAM :
Generally a number is said to be a palindrome number if its reverse is same as the original number .
For Example : 121 is a palindrome as its reverse is also 121 where as , 231 is not a palindrome as its reverse is 132 .
PROGRAM :
#include <stdio.h> #include <stdlib.h> int main() { int number,remainder,reverse=0,num; printf("Enter a number :\t"); scanf("%d",&number); num=number; while(number) { remainder = number%10; reverse= reverse*10+remainder; number=number/10; } if(reverse == num) printf("%d is Palindrome",num); else printf("%d is not a Palindrome",num); return 0; }OUTPUT :
C - Palindrome or not |