write a function to find whether a string is palindrome or
not and how many palindrome this string contain?
Answer Posted / nm
bool palindrome(char *str){
char *ptr1 = str;
char *ptr2 = str + strlen(str) - 1;
while(ptr1 < ptr2){
if(*ptr1 != *ptr2)
return false;
ptr1++;
ptr2--;
}
return true;
}
| Is This Answer Correct ? | 30 Yes | 29 No |
Post New Answer View All Answers
What is the difference between fread and fwrite function?
What is the auto keyword good for?
What do you mean by scope of a variable in c?
How can a process change an environment variable in its caller?
What are the features of the c language?
Tell me can the size of an array be declared at runtime?
my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
What is volatile c?
What are the properties of union in c?
What is the purpose of 'register' keyword?
Does c have class?
What is the difference between strcpy() and memcpy() function in c programming?
What are the benefits of c language?
What is structure padding and packing in c?