Login to ask a question from Recursive program in c

Program to find Palindrome using Recursion

A Palindrome is a sequence that if reversed looks identical to the original sequence Eg : abba, level, 999 etc.

Below is a simple C program to find whether the user input number is a palindrome or not using recursion:

Source code:

#include


// declaring the recursive function

int isPal(int );


/*

    global declaration to use the same value 

    in both the functions

*/

int n;


int main()

{

    int palindrome;

    printf("\n\nEnter a number to check for Palindrome: ");

    scanf("%d", &n);

    palindrome = isPal(n);

    if(palindrome == 1)

        printf("\n\n\n%d is palindrome\n\n", n);

    else

        printf("\n\n\n%d is not palindrome\n\n", n);

    return 0;

.... Show More
Previous Question Next Question
🔗

Similar Questions

From Recursive program in c · C programming

View All
WhatsApp