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 are pointers?

621


What is #define used for in c?

607


Explain what will the preprocessor do for a program?

591


How do we print only part of a string in c?

579


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

770






Explain void pointer?

583


What is multidimensional arrays

622


When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.

1520


Are global variables static in c?

664


What is register variable in c language?

594


What does & mean in scanf?

595


What are the 4 types of functions?

561


What is volatile c?

513


Explain the difference between malloc() and calloc() in c?

569


What are the 5 organizational structures?

557