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
show how link list can be used to repersent the following polynomial i) 5x+2
What is pointers in c with example?
Why main is used in c?
What are the different data types in C?
What is the difference between malloc() and calloc()?
Why is c not oop?
What is sizeof c?
Is there sort function in c?
Which is better oop or procedural?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
Describe how arrays can be passed to a user defined function
What is the difference between near, far and huge pointers?
Is c easier than java?
How to explain the final year project as a fresher please answer with sample project
What is wrong with this initialization?