C program to check whether a given number is palindrome or not using recursion

program to check whether a given number is palindrome or not using recursion

Palindrome number is an Integer Number.  If the reverse of the given number is equal to the given number, then the given number is called Palindrome number. Example of Palindrome Number : 5115. The below given C program to check whether a given number is palindrome or not using recursion. Kindly check out the program to check whether a given number is palindrome or not using recursion.


Program to check palindrome or not using recursion


#include<stdio.h>

int reverse(int);

int main(){

    int numbr,sum;

    printf("Enter a number: ");

    scanf("%d",&numbr);

    sum = reverse(numbr);

    if(numbr==sum)

         printf("The given number  %d is a palindrome",numbr);

    else

    printf("The given number  %d is not a palindrome",numbr);

    return 0;

}

int reverse(int num){

    int rem;

static int sum=0;

    if(num!=0){

         rem=num%10;

         sum=sum*10+rem;

         reverse(num/10);

    }

    return(sum);

}

 


Sample output:

Enter a number: 25

The given number  25 is not a palindrome

 

Enter a number: 252

The given number  252 is a palindrome


Other Related C Programs :


* C Program to find whether the given number is Odd or Even

* C Program to find the Sum of Odd Digits

* C Program to find the Sum of Even Digits

* C Program to find the Sum of Even and Odd Digits,

* C Program to Display Odd digits

* C Program to Display even digits

* C Program to Display Odd Numbers,

* C Program to Display Even Numbers,

* C Program to Check whether the given number is Armstrong number

* C Program to display the Armstrong numbers in Range

* C Program to display the Armstrong numbers between 1 and 1000

* C Program to check perfect number, perfect numbers in range

* C Program to Check Prime number, Prime numbers between 1 and 100

* C Program to display the Prime numbers in a Range

* C Program to display the Sum of Prime numbers

* C Program to Check Strong number

* C Program to display the Strong number in Range

* C Program to Check whether the given number is polindrome number or not

* C Program to Check polindrome number using for loop

* C Program to Check polindrome number using Recursion

* C Program to  check whether the given string is polindrome or not

* C Program to find the Roots of Quadratic equation

* C Program to display Fibonacci Series

* C Program to display the Fibonacci Series using an array

* C Program to display the Fibonacci Series using while loop

* C Program to find the Sum of Fibonacci Series, Factorial of Number

* C Program to find the Factorial without using Recursion

* C Program to find the Factorial using Pointers

* C Program to find the Factorial using Function

Bookmark and Share