#include<math.h>
void main()
{
long int n, num, rev = 0, dig;
clrscr();
printf(“nnt ENTER A NUMBER…: “);
scanf(“%ld”, &num);
n = num;
while(num>0)
{
dig = num % 10;
rev = rev * 10 + dig;
num = num / 10;
}
if (n == rev)
printf(“nt GIVEN NUMBER IS A PALINDROME”);
else
printf(“nt GIVEN NUMBER NOT A PALINDROME”);
getch();
}
Not Satisfied ? Just search & get the result
Related posts:
- C program to reverse a given integer number and check whether it is a palindrome. Output the given numbers with suitable message
- C program – To check whether the given string is palindrome
- C program to find the length of a string without using the built-in function also check whether it is a palindrome or not
- C program to check whether a given number is prime or not and output the given number with suitable message
- C Program To find the sum of digits
