Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Find string palindrome 10marks

Answer Posted / abdur rab

#include <stdio.h>

int isPalindrome ( char* str, int nLength )
{
if ( nLength < 1 ) return ( 1 );
if ( str [0] == str [ nLength -1 ] ) return (
isPalindrome ( ( str + 1 ) , ( nLength - 2 ) ) );
else return ( 0 );
}

int main (int argc, char* argv[])
{
char a[10] = {"ropepor"};
if ( isPalindrome ( a, strlen ( a ) ) ) printf
("\n The string is Palindrome");
else printf ("\n The string is NOT Palindrome");
return (1 );

Is This Answer Correct ?    7 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a void pointer? When is a void pointer used?

1034


How can I do peek and poke in c?

1048


What does 2n 4c mean?

1199


What are the advantages and disadvantages of a heap?

1159


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

1023


Can we replace the struct function in tree syntax with a union?

1252


Why doesnt that code work?

1097


Can math operations be performed on a void pointer?

1007


What is a rvalue?

1149


Why c is procedure oriented?

1012


Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.

4174


How main function is called in c?

1087


What's the difference between constant char *p and char * constant p?

1101


Is c# a good language?

976


What is console in c language?

1063