write a function to find whether a string is palindrome or
not and how many palindrome this string contain?
Answer Posted / nm
bool palindrome(char *str){
char *ptr1 = str;
char *ptr2 = str + strlen(str) - 1;
while(ptr1 < ptr2){
if(*ptr1 != *ptr2)
return false;
ptr1++;
ptr2--;
}
return true;
}
Is This Answer Correct ? | 30 Yes | 29 No |
Post New Answer View All Answers
how should functions be apportioned among source files?
What is the best way to store flag values in a program?
What are pointers?
what is the height of tree if leaf node is at level 3. please explain
What is difference between class and structure?
Explain high-order and low-order bytes.
What is a memory leak? How to avoid it?
How to throw some light on the b tree?
What is meant by initialization and how we initialize a variable?
Explain what are preprocessor directives?
in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures
What is the size of structure in c?
How important is structure in life?
What is nested structure?
Which header file should you include if you are to develop a function which can accept variable number of arguments?