Palindrome number | C language
About Palindrome:
Write a C-Program to check weather the number is palindrome or not:
Code:
#include<stdio.h> #include<conio.h> void main() { int n,m,a,b=0; printf("Enter a number:\n"); scanf("%d",&m); n=m; while(n!=0) { a=n%10; n=n/10; b=b*10+a; } printf("%d\n",b); if(b==m) printf("The number is palindrome"); else printf("Not a palindrome"); getch(); }
Output:
-------------------
C Program : String Palindrome
C Program : String Palindrome
Comments
Post a Comment
Give your feedback!
DO NOT SPAM !!
NO THIRD PARTY PROMOTIONAL LINK !!!! (else comment will be deleted.)