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
Why enum is used in c?
code for quick sort?
Explain what is the benefit of using const for declaring constants?
Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.
Why is c called "mother" language?
What type of function is main ()?
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
What is pivot in c?
What is a nested loop?
What is the difference between pure virtual function and virtual function?
What is #ifdef ? What is its application?
Why we use stdio h in c?
What is a macro?