C Program to check input number is Palindrome or not

#include<stdio.h>
#include<conio.h>
void main()
{
int r,x=0,temp;
int y;
clrscr();
printf("Enter Number:- ");
scanf("%d",&y);
temp=y;
while(y>0)
{
 r=y%10;
 x=(x*10)+r;
 y=y/10;
}
if(temp==x)
 {
 printf("Number is palindrome");
 }
 else
 {
  printf("Number is not palindrome");
 }

getch();
}

OUTPUT:-

Leave a Reply

Your email address will not be published. Required fields are marked *