Monday, 19 October 2015

C program to check whether a no. is palindrome or not

#include<stdio.h>
#include<conio.h>
void main()
{
int x,r,y;
clrscr();
printf("enter a no :");
scanf("%d",&y);
x=y;
while(x!=0)
{
r=x%10;
printf("%d",r);
x=x/10;
}
getch();
if(y==r)
printf("\n no.is palindrome");
else
printf("\n no. isn't palindrome");
getch();
}

No comments:

Post a Comment