Program to check whether number is palindrome or not

program:-

#include<stdio.h>
#inclue<conio.h>
void main()
{
int n,n1,r,rev; //r=reminder & rev=reverse
printf(“Enter a number”);
scanf(“%d”,&n);
n1=n;
while(n!=0)
{
r=n%10;
rev=rev*10+r;
n=n/10;
}
if(n1==rev)
printf(“number is palindrome”);
else
printf(“not palindrome”);
getch ();
}


10 thoughts on “Program to check whether number is palindrome or not

Leave a Reply

Your email address will not be published.