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

What is sizeof c?

715


How can I write a function that takes a format string and a variable number of arguments?

685


What is the use of bitwise operator?

776


Is calloc better than malloc?

671


Can we assign string to char pointer?

678






Can a file other than a .h file be included with #include?

777


What is main return c?

605


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

703


What is calloc malloc realloc in c?

688


What is the use of volatile?

733


What is actual argument?

681


WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.

2119


Where in memory are my variables stored?

717


What are high level languages like C and FORTRAN also known as?

797


Why cant I open a file by its explicit path?

695