Monday, 6 May 2013

Program In C to Check Whether A Number IS Palindrome Or Not


#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d;
clrscr();
printf(" Enter a  number\n");
scanf("%d" , &a);
c=0;
d=a;
while(a>0)
{
b=a%10 ;
c=(c*10)+b ;
a=a/10;
}
if(c==d)                                              
{
printf(" Number Is palindrome ");
}
else
{
printf(" Number is not palindrome ");
}
getch();
}

No comments:

Post a Comment