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

show how link list can be used to repersent the following polynomial i) 5x+2

1668


What is pointers in c with example?

571


Why main is used in c?

577


What are the different data types in C?

716


What is the difference between malloc() and calloc()?

609






Why is c not oop?

533


What is sizeof c?

596


Is there sort function in c?

568


Which is better oop or procedural?

616


hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell

1656


Describe how arrays can be passed to a user defined function

772


What is the difference between near, far and huge pointers?

622


Is c easier than java?

560


How to explain the final year project as a fresher please answer with sample project

459


What is wrong with this initialization?

575