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...

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


Please Help Members By Posting Answers For Below Questions

What is the difference between constant pointer and constant variable?

1220


How can I write a function analogous to scanf?

1177


What are 'near' and 'far' pointers?

1034


PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE

2019


What does %c do in c?

983


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

1270


How can you increase the allowable number of simultaneously open files?

1151


What are the different types of control structures?

1040


How can variables be characterized?

2184


What is volatile, register definition in C

1104


What is variable declaration and definition in c?

896


What is the ANSI C Standard?

1268


What are # preprocessor operator in c?

1104


Which is an example of a structural homology?

1321


What is the use of in c?

1024