title: Converting char to Int with getchar() extra numbers
body: <p>I want to convert a char to an int. However when I use the usual way of </p>
  
  <pre><code>convertedInt = c - '0'; 
  </code></pre>
  
  <p>I get an extra negative number when printing the results. For instance this code with the input 654 produces the output:</p>
  
  <pre><code>    while (c != '\n'){
          c = getchar();
          convertedInt = c - '0';
          printf("%d\n", convertedInt);
      }
  
      //Output
      4
      5
      6
      -38
  </code></pre>
  
  <p>I don't think it has anything to do with the getchar because if I just print the char without converting it I get the expected output. </p>