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 |
What is the use of function overloading in C?
What is keyword with example?
a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);
What is unsigned int in c?
Explain #pragma statements.
WAP to convert text into its ASCII Code and also write a function to decode the text given?
write a c program to find largest of three numbers using simple if only for one time.
program to print circle structure
can we write a c program with out using main
What are advantages and disadvantages of recursive calling ?
12 Answers College School Exams Tests, Evolving Systems, HP, Jyoti Ltd, Sage, Wipro,
Fifty minutes ago if it was four times as many mints past 3 o clock. how many minutes is it to six o'clock n how....?????
Total of how many functions are available in c?