Wednesday 30 January 2013

WAP TO FIND THAT NUMBER IS PALANDROM OR NOT (121=121)


#include
void main ()
{
int no,r,res,temp=0;
clrscr ();
printf ("Enter Number: ");
scanf ("%d",&no);
r=res=0;
temp=no;
while (no>0)
{
r=no%10;
no=no/10;
res=(res*10)+r;
}
if (temp==res)
printf("Number is Palandrom");
else
printf("Number is not Palandrom");
getch ();
}

No comments:

Post a Comment

Comment