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
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
What is meant by gets in c?
What is call by reference in functions?
Explain goto?
Explain the Difference between the New and Malloc keyword.
How can I remove the trailing spaces from a string?
how to make a scientific calculater ?
What Is The Difference Between Null And Void Pointer?
What are the benefits of organizational structure?
What is the purpose of the preprocessor directive error?
number of times a digit is present in a number
What is a volatile keyword in c?
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
a program that can input number of records and can view it again the record
What is unary operator?