#include(stdio.h) // place this '<' & '>' instead of '(' & ')' before stdio.h
#include(conio.h)
void main( )
{
int no, rem, rev=0, temp;
clrscr( );
printf("Enter the required integer:");
scanf("%d", &no);
temp=no;
while(temp>0)
{
rem=temp%10;
rev=(10*rev)+rem;
temp=temp/10;
}
if(no==rev)
printf("\n%d is Palindrome number", no);
else
printf("\n%d is not a palindrome string", no);
getch();
}
Output:-
Enter the required number: 141
141 is palindrome number.
Note:- If u have any doubt regarding this program or logic, please feel free to contact me.
Friday, February 20, 2009
Subscribe to:
Post Comments (Atom)
tel me the logic
ReplyDeletecheck out C program to check whether a number is Palindrome or not
ReplyDelete