Hello I was wondering if anyone could help me with this prog
Hello I was wondering if anyone could help me with this programming assignment in C. Thanks in advance! : Write a function and its prototype which return true if the string parameter is a palindrome.A palindrome is any \"word\" which is the same forward and backward, eg, \"radar\", \"noon\", \"20011002\", ... The function should return false if the argument is not a palindrome.
Solution
bool Is Palindrome( char *s1)
{
char *s2;
int len;
len = strlen(s1);
s2 = s1;
while (*s2 != \'\\0\') {
s2++;
}
s2--;
for ( int i = 0; i < len/2; i++) {
if (*s2 != *s1) {
return false ;
}
s1++;
s2--;
}
return true ;
}
