PROGRAM TO CHECK WHETHER A GIVEN NUMBER IS PALINDROME OR NOT

/*PROGRAM TO CHECK WHETHER A GIVEN NUMBER IS PALINDROME OR NOT*/
#include<stdio.h>
#include<conio.h>
void main()
{
int n,temp,rev=0,rem;
clrscr();
printf(“Enter the number: “);
scanf(“%d”,&n);
temp=n;
while(temp>0)            //FINDING REVERSE
{
rem=temp%10;
temp=temp/10;
rev=rev*10+rem;
}
if(rev==n)
{
printf(“Number %d is a palindrome number”,n);
}
else
{
printf(“Number %d is not a palindrome number”,n);
}
getch();
}

Leave a Reply

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