Find string palindrome 10marks

Answer Posted / vivek

bool
IsPalindrome( char *lpStr )
{
int n,i;
n = strlen( lpStr );
for ( i = 0; i < n/2; i++ )
{
if ( lpStr[i] != lpStr[n-i-1] )
{
return FALSE;
}
}
return TRUE;
}

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none

640


What is the total generic pointer type?

723


What is pass by value in c?

593


What is wrong with this program statement? void = 10;

817


Explain what is a pragma?

590






What are the rules for the identifier?

668


What is difference between structure and union in c?

544


Why is c platform dependent?

617


Explain the Difference between the New and Malloc keyword.

685


How can I do graphics in c?

588


How are variables declared in c?

598


What is the difference between struct and union in C?

568


What is the sizeof () a pointer?

545


What are c identifiers?

626


a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.

4541