text: /*
  @@@@ PROGRAM NAME: knkcch13proj17.c
  @@@@ FLAGS: -std=c99
  @@@@ PROGRAM STATEMENT: 
  Modify Programming Project 2 from Chapter 12 so that it includes the following function:
  
  	bool is_palindrome(const char *message);
  
  The function returns true if the string pointed to by message is a palindrome.
  */
  #include<stdio.h>
  #include<ctype.h>  //tolower(), isalpha()
  #include<stdbool.h>  //bool, true, false
  #include<string.h>  //strcpy().
  //-----------------------------------------------------------------------------
  //-----------------------------------------------------------------------------
  bool is_palindrome(const char *message);
  //-----------------------------------------------------------------------------
  //-----------------------------------------------------------------------------
  //-----------------------------------------------------------------------------
  //-----------------------------------------------------------------------------
  //------------------------START OF MAIN()--------------------------------------
  int main(void)
  {
  	printf("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
  	
  	char message[80];
  	bool palindrome=true;
  	
  	//Getting meesage from user.
  	printf("Enter a message: ");
  	gets(message);
  	*(message+79)='\0';
  
  	palindrome=is_palindrome(message);
  	if(palindrome)
  		printf("Palindrome.");
  	else
  		printf("Not a palindrome.");
  
  
  	printf("\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
  	return 0;
  }
  //-------------------------END OF MAIN()---------------------------------------
  bool is_palindrome(const char *message)
  {
  	char a[80],ch,*p=a,*q=a;
  	
  	strcpy(a,message);
  
  	while(ch=tolower(*message++))
  		if(isalpha(ch))
  			*p++=ch;
  	
  	*p='\0';
  	while(--p>q)
  		if(*p!=*q++)
  			return false;
  	
  	return true;
  	
  }
  //---------------------------------------------------------------------------
  //---------------------------------------------------------------------------
  //-----------------------------------------------------------------------------
  //-----------------------------------------------------------------------------
  //-----------------------------------------------------------------------------
  //-----------------------------------------------------------------------------
  //-----------------------------------------------------------------------------
  //-----------------------------------------------------------------------------
  /*
  OUTPUT:
  @@@@ Trial1:
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  Enter a message: Palindrome
  Not a palindrome.
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  @@@@ Trial2:
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  Enter a message: Malayalam
  Palindrome.
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  @@@@ Trial3:
  @@@@ Trial4:
  @@@@ Trial5:
  @@@@ Trial6:
  @@@@ Trial7:
  @@@@ Trial8:
  @@@@ Trial9:
  */
  //---------------------------------------------------------------------------