title: read int with scanf until new line
body: <p>I'm new to the c language and used java before, so I'm not so familiar with some things... I want to read an indefinite number of integer until there's a new line. I know, that new line is ⁄n and I already have a code, so the integer are read until you type in a letter, but it doesn't stop, if there's a new line.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
  
  int i, numberOfNumbs=0,total=0,value, valsRead;
  float average;
  
  valsRead = scanf("%d",&amp;value);
  
  while(valsRead&gt;0)
  {
  numberOfNumbs++;
  total +=value;
  printf("Read %d\n", value);
  valsRead = scanf("%d",&amp;value);
  }
  
  average=(float)total/(float)numberOfNumbs;
  printf("You read %d values. Average = %f.",numberOfNumbs, average);
  
  return (0);
  }
  </code></pre>
  
  <p>The input should be something like this:
  23 4 114 2 34 3224 3 2 ⁄n</p>
  
  <p>Thanks in advance</p>