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
What is const volatile variable in c?
Array is an lvalue or not?
How will you delete a node in DLL?
What is switch in c?
What is the difference between formatted&unformatted i/o functions?
Explain what is the difference between null and nul?
if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0
What is wrong with this program statement? void = 10;
Why pointers are used?
What is difference between union and structure in c?
How we can insert comments in a c program?
write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a
Write a program to print all permutations of a given string.
Why shouldn’t I start variable names with underscores?
Explain about block scope in c?