Definition of palindrome number – A palindrome number is a sequence of digits that can be read in the same way in both the directions , from left to right and right to left. For ex – 121, 123321, etc
Below is the C program in the C programming language to check if the inputted number is a palindrome number or not-
/* C program to check if the inputted number is palindrome number or not */ #include<stdio.h> void main() { int n,n2,n3=0,i; printf("Enter any number to check if no. is palindrome or not \n"); scanf("%d",&n); n2=n; do { i=n%10; n=n/10; n3=n3*10+i; } while(n>0); if(n3==n2) { printf("%d is a palindrome number",n3); } else { printf("%d is not a palindrome number",n2); } getch(); }
thanks for the post. because of this post I have been able to write a program to find whether a number is armstrong or not using function. Please have a look.
http://ioeengineer.blogspot.com/2014/03/to-find-whether-number-is-palindrome-or.html