Recursive function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ramki
    New Member
    • Oct 2006
    • 1

    Recursive function

    Hi....all

    anyone help me following question

    recursive program in C to find whether a given five digit number is a palindrome or not.
  • svlsr2000
    Recognized Expert New Member
    • Feb 2007
    • 181

    #2
    Originally posted by ramki
    Hi....all

    anyone help me following question

    recursive program in C to find whether a given five digit number is a palindrome or not.
    Hi,
    this algorithm would of help to you

    if(string[first] is not equal to string[last])
    retrun not a palindrome
    if(first equal to last)
    return palindrome
    if(first is less then last)
    return not palindrome
    call palindrome(stri ng, increment first, decrement last)

    Comment

    Working...