Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions