Program Description:

In this program we are going to check whether a number is a palindrome number or not. Palindrome numbers are those numbers which if reversed remains the same. For example, 12221- If we reverse the digits the number 12221 the result will also be 12221, so it is a palindrome number. But if we reverse the digits of 14253 then we will get 35241 which is not the same as of the previous number. So, 14253 is not a palindrome number.To do this program we will use the concepts of '/'(division) and '%'(Modulus) operator.

Source Code:

#include<stdio.h>
int main()
{
int r,n,sum=0,i;
printf("Enter a number:");
scanf("%d",&n);
i=n;
while(n>0)
{
r=n%10;
sum=sum*10+r;
n=n/10;
}
if(sum==i)
printf("%d is a palindrome number",i);
else
printf("%d is not a palindrome number",i);
}


Output:


If you have any queries feel free to ask us in the comments section below!!