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


Please Help Members By Posting Answers For Below Questions

Which is best book for data structures in c?

850


What is the sizeof () operator?

819


I have seen function declarations that look like this

849


How can I get back to the interactive keyboard if stdin is redirected?

919


How can you find out how much memory is available?

841


What is meant by operator precedence?

904


What does struct node * mean?

826


In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping

1228


What language is windows 1.0 written?

810


How do I round numbers?

801


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

1058


What does char * * argv mean in c?

842


main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }

1197


What happens if you free a pointer twice?

845


What is union and structure in c?

902