Write a program in C to find that number is palindrome or not (121=121)
#include <stdio.h>
#include <conio.h>
#include <math.h>
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 ();
}
Post a Comment