Write a C program that functions as a case insensitive palin
 Write a C++ program that functions as a case in-sensitive palindrome detector.  Program Input: A string of characters and/or numbers entered in the command prompt by the user, such as “mom,” “sister,” or “abcd231\" or \"I am a student.\" etc.    Program Output: The program just simply must state if the string given to the program by the user is a palindrome or not.  An example of how the interface for the user could look in the command prompt:              Please enter a string: Kayak             Your string is a palindrome! or              Please enter a string: Oneonta is great!             Your string is not a palindrome!    A palindrome is a word or a number or a sequence of words that can be read the same way from either direction, be it forwards or backwards. Punctuation and spaces between the words or lettering is allowed.  Samples of Palindromes  The longest single word palindrome in the English language contains nine letters and is “stratagem\" meaning mega tarts. Other fun palindromes exist such as:  Single Word Palindromes Anna, Civic, Kayak, Level, Madam, Mom, Noon, Radar, Tenet, Wow etc. Multiple Word Palindromes Don\'t nod. I did, did I? My gym Red rum, sir, is murder Step on no pets Top spot Was it a cat I saw? Eva, can I see bees in a cave? No lemon, no melon  Hint: a palindrome should mirror with respect to the middle position.   use tolower or toupper function, since we allow case in-sensitive, as both Mom and mom are palindrome http://www.cplusplus.com/reference/cctype/tolower/  bool ispalindrome(char * acstr); {         int len= strlen(acstr); //Use strlen to find the length of the word.           int middle;          middle=?;  //calcuate the middle length of the word,           for(int i=0; i<middle; i++)  //loop through the word from 0 position to the middle position            {                 if (tolower(acstr[i])!=tolower(acstr[len-1-i]))   // as i goes from 0 to the middle, and len-1-i goes from the end to the middle                          return false; // as soon as aymmetry is detected, false can be returuned.         }          return ?;   }    int main() {          const int STRLENGTH=100;         char aline[STRLENGTH];          cout<<\"Please input a sentence terminated by an enter key. \"<<endl;          cin.getline(aline, STRLENGTH);          if (ispalindrome(aline))         {                 //you need to output something         }         else         {                 // you need to output something         } };   Solution
#include <iostream>
 #include <cstring>
 using namespace std;
 bool ispalindrome(char * acstr)
 {
 int len= strlen(acstr); //Use strlen to find the length of the word.
int middle;
middle=len/2+1; //calcuate the middle length of the word,
for(int i=0; i<middle; i++) //loop through the word from 0 position to the middle position
{
 if (tolower(acstr[i])!=tolower(acstr[len-1-i])) // as i goes from 0 to the middle, and len-1-i goes from the end to the middle
 return false; // as soon as asymmetry is detected, false can be returned.
 }
return true; // returns true if no asymmetry found
 }
int main()
 {
const int STRLENGTH=100;
 char aline[STRLENGTH];
cout<<\"Please input a sentence terminated by an enter key. \"<<endl;
cin.getline(aline, STRLENGTH);
        // if the ispalindrome() returned true, means it is a palindrome
 if (ispalindrome(aline))
 {
 cout<<aline<<\" is a palindrome\";
 }
        // if the ispalindrome() returned false, means it is not a palindrome
 else
 {
 cout<<aline<<\" is not a palindrome\";
 }
 return 0;
 }
 -----------output-----------
 Please input a sentence terminated by an enter key.   
 Kayak
 Kayak is a palindrome main   
 Please input a sentence terminated by an enter key.   
 Hello   
 Hello is not a palindrome
 -----------output-----------
Note: All the changes are done in the program to print whether the line is palindrome or not. Please feel free to ask queries. God bless you!!

