PALANDROM NUMBER

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 ();

}


Labels