C Program to Check Whether a Number is Palindrome or Not

Below is a simple C program to check whether a number is a palindrome or not.

Program :

#include<stdio.h>
#include<conio.h>
main()
{
int n,r=0,t;
printf(“Enter a number to reverse : “);
scanf(“%d”,&n);
t=n;
while(n!=0)
{
r=r*10;
r=r+n%10;
n=n/10;
}
if(t==r)
{
printf(“%d is a Palindrome number.”,t);
}
else
{
printf(“%d is not a Palindrome number.”,t);
}
}

Output:

Leave a Comment

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

Shopping Basket
Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
Click outside to hide the comparison bar
Compare
Verified by MonsterInsights