This is a discussion on palindrome within the C and C++ forums, part of the Programming Talk category; how to check if any given number is a palindrome or not... the number is entered from the user...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
palindrome
Quote:
{ int n,d,sum=0,ori; printf("\nEnter any No. :"); scanf("%d",&n); ori=n; while(n>=1) { d=n%10; n=n/10; sum=sum*10+d; } if(sum==ori) printf("\n given number is a palindrome."); else printf("\ngiven number is a not palindrome."); getch(); } |
![]() |
| Thread Tools | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Projects In Java | Ro_Maniak | Project Requests | 5 | 07-15-2006 12:47 AM |