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

the maximum width of a c variable name can be a) 6 characters b) 8 characters c) 10 characters d) 20 characters

2 Answers  


how to copy a string without using c function

5 Answers  


List some of the static data structures in C?

0 Answers  


difference between malloc and calloc

3 Answers   HCL, Wipro,


Which node is more powerful and can handle local information processing or graphics processing?

0 Answers  


Write a program that accept anumber in words

0 Answers  


Explain #pragma in C.

1 Answers  


int main() { unsigned char a = 0; do { printf("%d=%c\n",a,a); a++; }while(a!=0); return 0; } can anyone please explain me output????

1 Answers  


helllo sir , what is the main use of the pointer ,array ,and the structure with the example of a programe

2 Answers  


using for loop sum 2 number of any 4 digit number in c language

0 Answers  


what are the advantage of pointer variables? write a program to count the number of vowels and consonants in a given string

3 Answers  


What is the difference between File pointer and Internal Charecter Pointer?

2 Answers   TATA,


Categories