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
we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
Why n++ execute faster than n+1 ?
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
what is recursion in C
What are external variables in c?
Differentiate between calloc and malloc.
What are the different types of endless loops?
Can we assign integer value to char in c?
Explain how does free() know explain how much memory to release?
What are c identifiers?
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }
What is the difference between strcpy() and memcpy() function in c programming?
How do I send escape sequences to control a terminal or other device?
Write programs for String Reversal & Palindrome check