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 / nadeem

bool palindrome(char *str){
char *ptr1 = str;
char *ptr2 = str + strlen(str) - 1;

while(ptr1 < ptr2){
if(*ptr1++!= *ptr2--)
return false;// not palindrome

}

return true;//palindrome


}

Is This Answer Correct ?    3 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is n in c?

1056


Can I initialize unions?

1045


What are keywords c?

1032


Is return a keyword in c?

1090


What are the data types present in c?

1164


What is a memory leak? How to avoid it?

1350


Is that possible to add pointers to each other?

1376


we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above

1163


What is the use of extern in c?

1094


Explain what are global variables and explain how do you declare them?

1175


How to delete a node from linked list w/o using collectons?

2782


Why is it that not all header files are declared in every C program?

1225


Is it possible to initialize a variable at the time it was declared?

1220


Write programs for String Reversal & Palindrome check

1062


Is python a c language?

1016