/* palindrome.cpp * Anthony Larrain * * This program will determine if a word is a palindrone. */ #include #include using namespace std; bool isPalindrome(const char *word); int main(int argc, char *argv[]) { const int WORDLEN = 21; char word[WORDLEN]; cout << "Enter word\t"; cin >> word; if(isPalindrome(word)){ cout << word <<" is a palindrone" << endl; }else{ cout << word <<" is not a palindrone" << endl; } system("PAUSE"); return EXIT_SUCCESS; } bool isPalindrome(const char *word){ int end = strlen(word) - 1; for(int begin = 0; begin < end; ++begin, --end){ if(*(word + begin) != *(word + end)){ return false; } } return true; }