Question: Write a c++ function that determines if a string is a palindrome or note. Here is the program that needs to be completed. /* *returns

Write a c++ function that determines if a string is a palindrome or note. Here is the program that needs to be completed.

/* *returns true if cstr is a palindrome; false, otherwise *assume cstr contains only lower case alphabetic characters *(i.e. it does not contain spaces or punctuation) */

bool isPalindrome(char * cstr) { //Assume strlen () returns the length of the string. int length = strlen (cstr); //COMPLETE THE CODE HERE }

int main ()

{ char s1[50]= "neveroddoreven"; chars2[50]= "notapalindrome"; cout<< isPalindrome (s1)<< endl; //true cout<< isPalindrome(s2) << endl; //false return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!