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
Which is best book for data structures in c?
What is the sizeof () operator?
I have seen function declarations that look like this
How can I get back to the interactive keyboard if stdin is redirected?
How can you find out how much memory is available?
What is meant by operator precedence?
What does struct node * mean?
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
What language is windows 1.0 written?
How do I round numbers?
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
What does char * * argv mean in c?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What happens if you free a pointer twice?
What is union and structure in c?