title: Strange 10 value gets printed when I print inputed characters by their ASCII decimal code
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
      int end;
  
      while(( end = getchar() ) != EOF ){
          printf(&quot;%d\n&quot;,end);
      }
      system(&quot;pause&quot;);
      return 0;
  }
  </code></pre>
  <p>I want to print the ASCII codes of characters with this code but whenever I run the code after it gets the char from me it prints its ASCII equivalent with decimal 10. For example if I run the code and pass &quot;a&quot;, it will print 97 and 10. Why does it print 10, this happens with all other characters too.
  Thank you for answers and as a followup question when I add a counter after I input a character counter's value increases by two, why does this happen</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
      int end;
      int count=0;
      while(( end = getchar() ) != EOF ){
          printf(&quot;%d\n&quot;,end);
          count++;
          printf(&quot;counter is now %d\n&quot;,count);
      }
      system(&quot;pause&quot;);
      return 0;
  }
  </code></pre>