Reverse of the given no. is equal to the given no. is known as a Palindrome no.
#include<stdio.h>
#include<conio.h> void main() { int rev=0,r,n,t=0; clrscr(); printf("enter a number:"); scanf("%d",&n); t=n; while(n!=0) { r=n%10; rev=rev*10+r; n=n/10; } if(rev==t) printf("palindrome"); else printf("not palindrome"); getch(); } |
Output:-
______________________________________________________
______________________________________________________
______________________________________________________
_____________________________________________________
Post a Comment