Home TechnologyProgrammingC++ Subscribe to RSS

WAP To Find Out The String Is Palindrome Or Not?

Answer Question

1 Answer - Sort by: Date | Rating

    Your program for finding Polindrome or not is:

    #include <iostream.h>

    #include <string.h>

    int main()

    {

    char str[100];

    cout << "Enter a word to check :";

    cin >> str;

    int x = strlen(str)-1;

    for(int i = 0; i <= x; i++)

    {

    if (str[i] == str[x-i])

    {

    continue;

    }

    else

    {

    cout<<"Not a palidrome"<<endl;

    return 0;

    }

    }

    cout << "Entered word is Polindrome"<<endl;

    return 0;

    }
    1 0

    Alon_nad 

    answered 4 months ago

      More

         
         

        Ask a Question via Twitter

        Send a question to @askblurtit and we will publish it online and send you a reply everytime you receive an answer.

        Blurtit Store

        Get T-shirts, hoodies, caps and more at the Blurtit store

        Blurtit International