Find a palindromic string in C This program tests whether a string is a palindrome or not.
Can there be any improvements or shortcuts that can be used in the program. You can give any type of string as input. The program finds does it work. 

#include &lt;stdio.h&gt;
#include &lt;string.h&gt;

/*
A palindrome is a string that is same in both forward and backward reading.
Example:
   "madam"
   "racecar"
   "a man a plan a canal panama"
   "radar"
You will write a program that will test if a given string is a palingdrome or not.
Your program will ask the user to input a string and if the string is a palindrome program
will just print "Yes, it is a Palindrome", otherwise will print "No, not a Palindrome".

Please note that:
1. Your you need to check in case-insensitive way, that means: Madam or madam both should be
detected as Palindrome.

2. There can be (any number of ) spaces in between the words.
    "A man a plan a canal panama"
        OR
    "A     man    a   pla n a cana l Panama"
    both the strings must be detected as Palindrome.
3.There can be punctuations in between the words, for this assignments,
we consider only 4 punctuations,   . ?  ! and ,

Your program will just need to ignore them (treat them as space).
    "Cigar? Toss it in a can. It is so tragic."
    Should be detected as palindrome.

 *** For this assignment I will not write any instructions or guidance, you are free
        to implement it with your own way, you can use the string.h functions

    Good luck.

*/

/***********************************************************************

    Created by Shaik Mohammed Zeeshan
    Date - 19 Aug 2018
    Objective - Checks whether a given string is palindrome or not

************************************************************************/

int main()
{
    char string[100];
    char string1[100];//the string without spaces and special characters will be stored in this

    printf("Enter a string: ");
    scanf("%[^\n]", string);

    int isPalindrome = 1;  // assign 0 to this if the string is a NOT palindrome

    // write code to test if string is a palindrome

    int index;
    int index1;//index for the second array

    for(index=0,index1=0;string[index] != '\0'; index++)  //to eliminate spaces, special characters and capital letters from the string
    {
        if( (string[index] &lt; 'A' || string[index] &gt; 'Z' ) &amp;&amp; (string[index] &lt; 'a' || string[index] &gt; 'z' ) ) // checks if the element is a special   
            continue;                                                                              // character or space and skips the iteration

        if(string[index] &gt;= 'A' &amp;&amp; string[index] &lt;= 'Z' )
            string[index] += 32;

        string1[index1] = string[index];
        index1++;
    }
    string1[index1] = '\0'; // assigning the last element with null character

    int i,stringlength = strlen(string1); // storing length after eliminating unecessary characters 

    for(i=0;i&lt;=stringlength/2;i++) //starts the loop from first element to the middle element
    {
        if(string1[i] != string1[stringlength-i-1]) //checks if the elements are true 
        {
            isPalindrome = 0;   // checks the first  element with the first element from the last and second element with the penultimate element and so on
            break;
        }
    }

    // at the end you need to test
    if (isPalindrome)
        printf("Yes, it is Palindrome!\n");
    else
        printf("No, not a Palindrome\n");

    return 0;
}
The amount of comments you use is more distracting than helpful. Good comments are those that explain what the overall logic of a block of code is, they don’t explain each line of code. Code is supposed to be self-documenting, that is, the code should explain itself. You accomplish this by using good variable names and good function names, which explain their own meaning.

Also, you need to use the functionality in the standard library. For example, to test whether a character is a normal letter or not, use isalpha rather than the four comparisons you’re using (against 'a', 'z', etc.)