Search & Find out

Saturday, November 21, 2009

palindrome or not

#include"stdio.h"
#include"conio.h"
 

 void main()
{
int m, n, q, r,s;
clrscr();
printf("Welcome to Palindrome\n");
printf("\n Enter the number");
scanf("%d", &n);
m=n;
for(s=0; n>0;)
{
q=n/10;
r=n%10;
s=(s*10)+r;
n=q;
}
if(s==m)
{
printf("The number is a palindrome");
}
else
{
printf("The number is not a palindrome");
}

getch();
}


Download the executable (.exe)  file for this program..
download

0 comments:

Post a Comment

 

My Blog List

Term of Use