title: string length with fgets function in C
body: <p>I have a problem. I've tried to see the length of some string after using fgets function. If I enter string under the number of letter which can be in the string (like: the maximum letters in string is 9 and I enter 4 letters), I get length of the string+1. why?</p>
  
  <p>Here's my code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  int main(void)
  {
      char name[10]={0};
      printf("enter your name\n");
      fgets(name, 10, stdin);
      printf("your name is %s and it is %d letters\n", name, strlen(name)); // length problem 
  
      return 0;
  } 
  </code></pre>