/* WHETHER A GIVEN NUMBER IS POLYNDROME OR NOT */
#include<stdio.h>
#include<conio.h>
main()
{
int rev=0,a,n,temp;
clrscr();
printf("\n Enter a Number:");
scanf("%d",&n);
temp=n;
while(n>0)
{
a=n%10;
rev=rev*10+a;
n=n/10;
}
if(rev==temp)
{
printf("\n The given number is polydrome: %d",temp);
}
else
{
printf("\n The given number is not a polyndrome: %d",temp);
}
getch();
}
#include<stdio.h>
#include<conio.h>
main()
{
int rev=0,a,n,temp;
clrscr();
printf("\n Enter a Number:");
scanf("%d",&n);
temp=n;
while(n>0)
{
a=n%10;
rev=rev*10+a;
n=n/10;
}
if(rev==temp)
{
printf("\n The given number is polydrome: %d",temp);
}
else
{
printf("\n The given number is not a polyndrome: %d",temp);
}
getch();
}

No comments:
Post a Comment