title: Printing numbers in C
body: <p>So my problem is this I want to print numbers that come from the terminal while the numbers are different than the EOF. </p>
  
  <p>For example if put 007 as the input, I want the output to be 7 or if I put 42 I want the output to be 42.</p>
  
  <p>But for some reason, the output I get is a random number, that I cant understand.</p>
  
  <p>program:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void ex04();
  
  int main() {
      ex04();
  
  return 0;
  }
  
  void ex04() {
      int c;
      c = getchar();
      while (c != EOF) {
          printf("%d\n",c);
          c = getchar();
      }
  }
  
  </code></pre>
  
  <pre><code>Input: 007
  
  my Output:
  
             48
             48
             55
             10
  
  Correct Output: 7
  
  </code></pre>
  
  <p>Any help would be appreciated.</p>