C Program to check number is palindrome or not! :
The reversed number is equal to the actual number is called palindrome.
In other word we input an number and calculate the reverse, if the reverse is equal to the actual number then its called the palindrome of any number.
For Example:The inputted number is 12521. and the reverse of this number is also 12521. that means this number is palindrome.

There some example of palindrome number: 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111, 121, 131, 141, 252, 696, 989 these all are called palindrome numbers.
Lets see some different program to check the given number is palindrome or not!.
ALGORITHM:-

step 1 : Start
step 2 : Input any number from user
step 3 : Calculate the reverse of the number
step 4 : if the reverse number is equal to the actual number,  is palindrome
step 4 : else Not a palindrome number
step 5 : Stop



#include<stdio.h>
#include<conio.h>

1. C program to find whether a number is palindrome or not

void main()
{
    int num,r,sum=0,temp;

    printf("Enter a number: ");
    scanf("%d",&num);

    temp=num;
    while(num)
    {
         r=num%10;
         num=num/10;
         sum=sum*10+r;
    }
    if(temp==sum)
    {
         printf("%d is a palindrome",temp);
    }
    else
    {
         printf("%d is not a palindrome",temp);
    }
    getch()
}

Sample output:
Enter a number: 131
131 is a palindrome


2. find palindrome number in an given range

void main()
{
    int num,r,sum,temp;
    int min,max;

    printf("Enter the minimum range: ");
    scanf("%d", &min);

    printf("Enter the maximum range: ");
    scanf("%d", &max);

    printf("Palindrome numbers in given range are: ");
    for(num = min; num <= max; num++)
    {
         temp = num;
         sum = 0;

         while(temp)
         {
             r = temp % 10;
             temp = temp / 10;
             sum = sum * 10 + r;
         }
         if(num == sum)
             printf("%d ", num);
    }
    getch();
}


Sample output:
Enter the minimum range: 1
Enter the maximum range: 50
Palindrome numbers in given range are: 1 2 3 4 5 6 7 8 9 11 22 33 44


3. How to check if a number is a palindrome using for loop

void main()
{
    int num,r,sum=0,temp;

    printf("Enter a number: ");
    scanf("%d", &num);

    for(temp = num; num != 0; num = num / 10)
    {
         r = num % 10;
         sum = sum * 10 + r;
    }
    if(temp == sum)
    {
         printf("%d is a palindrome", temp);
    }
    else
    {
         printf("%d is not a palindrome",temp);
    }
    getch();
}

Sample output:
Enter a number: 1221
1221 is a palindrome


4. Check if a number is palindrome using recursion


int checkPalindrome(int);
void main()
{
    int num,sum;

    printf("Enter a number: ");
    scanf("%d",&num);

    sum = checkPalindrome(num);

    if(num==sum)
    {
         printf("%d is a palindrome",num);
    }
    else
    {
        printf("%d is not a palindrome",num);
    }

    getch();
}

int checkPalindrome(int num)
{

    static int sum=0,r;
    if(num!=0)
    {
         r=num % 10;
         sum=sum * 10 + r;
         checkPalindrome(num / 10);
    }

    return sum;
}

Sample output:
Enter a number: 25
25 is not a palindrome

C Program to check weather the given number is palindrom or not.
how to find the number is palindrom or not!
Check the number is palindrom