C Program to check number is palindrome

Last Updated on

/* Before moving towards the program, a little introduction to the one who dose not know what is palindrome. A palindrome is a word, phrase, number, or other sequence of symbols or elements, whose meaning may be interpreted the same way in either forward or reverse direction i.e if we look from the backwards or from the front , they look same. Here are some examples that will help you to understand it better. Ex:  12321 , 676, nitin, madam, arora etc. No we move ahead to program to check whether a number is Palindrome or not palindrome */

#include<stdio.h>

#include<conio.h>

#include<math.h>

void main()

{

   int n,digit, n1,rev=0;

   clrscr();

   printf(“Enter the Any Integer No: “);

   scanf(“%d”,&n);

   n1=n;

   while(n!=0)

   {

      digit = n%10;

      rev=rev*10+digit;

      n/=10;

   }

   if (rev==n1)

      printf(“%d number is Palindrome “,n1);

   else

      printf(“%d number is Not Palindrome “,n1);

   getch();

}

resume

Mohit Arora
Follow me