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?

Answers were Sorted based on User's Feedback



write a function to find whether a string is palindrome or not and how many palindrome this string..

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

write a function to find whether a string is palindrome or not and how many palindrome this string..

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

More C Interview Questions

What does nil mean in c?

0 Answers  


What is pointers in c?

0 Answers  


What are near, far and huge pointers?

0 Answers   Hexaware, Thomson Reuters, Virtusa,


Expand the following LKB BKL FFG

0 Answers  


Can the sizeof operator be used to tell the size of an array passed to a function?

0 Answers  


What is the use of keyword VOLATILE in C?

1 Answers  


Write code for initializing one dimentional and two dimentional array in a C Program?

5 Answers   Deshaw, Edutech, GMD,


What does main () mean in c?

0 Answers  


Who developed c language?

0 Answers  


What is the difference between memcpy and memmove?

0 Answers  


what is software?

7 Answers   Wipro,


# define x=1+4; main() { int x; printf("%d%d",x/2,x/4); }

5 Answers  


Categories