write a function to find whether a string is palindrome or
not and how many palindrome this string contain?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
the maximum width of a c variable name can be a) 6 characters b) 8 characters c) 10 characters d) 20 characters
how to copy a string without using c function
List some of the static data structures in C?
difference between malloc and calloc
Which node is more powerful and can handle local information processing or graphics processing?
Write a program that accept anumber in words
Explain #pragma in C.
int main() { unsigned char a = 0; do { printf("%d=%c\n",a,a); a++; }while(a!=0); return 0; } can anyone please explain me output????
helllo sir , what is the main use of the pointer ,array ,and the structure with the example of a programe
using for loop sum 2 number of any 4 digit number in c language
what are the advantage of pointer variables? write a program to count the number of vowels and consonants in a given string
What is the difference between File pointer and Internal Charecter Pointer?