Question 1 Solution | Palindrome Solution | Codewindow.in

//codewindow.in
//solution function in java
void palindrome(char* input1)
{
    char *ptr, *rev;
    
    ptr = input1;
    
    while(*ptr !='\0')
    {
        ++ptr;
    }//codewindow
    --ptr;
    for(rev = input1; ptr>= rev;)
    {
        if(*ptr == *rev){
            --ptr;
            rev++;
        }
        else
        break;
    }//codewindow
    if (rev> ptr)
    return 1;
    else
    return 0;
}

Follow us

Also Checkout

Leave a Comment

Your email address will not be published. Required fields are marked *