write a function to find whether a string is palindrome or
not and how many palindrome this string contain?
Answer Posted / nadeem
bool palindrome(char *str){
char *ptr1 = str;
char *ptr2 = str + strlen(str) - 1;
while(ptr1 < ptr2){
if(*ptr1++!= *ptr2--)
return false;// not palindrome
}
return true;//palindrome
}
| Is This Answer Correct ? | 3 Yes | 6 No |
Post New Answer View All Answers
What is n in c?
Can I initialize unions?
What are keywords c?
Is return a keyword in c?
What are the data types present in c?
What is a memory leak? How to avoid it?
Is that possible to add pointers to each other?
we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above
What is the use of extern in c?
Explain what are global variables and explain how do you declare them?
How to delete a node from linked list w/o using collectons?
Why is it that not all header files are declared in every C program?
Is it possible to initialize a variable at the time it was declared?
Write programs for String Reversal & Palindrome check
Is python a c language?