title: strcat(); printing extra characters
body: <p>I have made strcat() function myself but after adding the string it is printing an extra ascii symbol.
  Please tell why?</p>
  
  <pre><code>  #include&lt;stdio.h&gt;
    #include&lt;conio.h&gt;
    #include&lt;string.h&gt;
    void xstrcat(char string1[],char string2[]);
    void main(void)
  { char x[100];
    char string1[40],string2[40];
    printf("Enter a string:");
    gets(string1);
    puts("Enter another string:");
    gets(string2);
    xstrcat(string1,string2);
    printf("%s",string1);
    getch();
  }
    void xstrcat(char string1[],char string2[])
  {
    int i,x,y;
    x=strlen(string1);
    y=strlen(string2);
    for(i=0;i&lt;y;i++)
    { string1[i+x]=string2[i];
    }//for ends
  }
  </code></pre>