title: How can I read a varying amount of integer input in C?
body: <p>I will be getting three lines of input. The first line will give me 2 integers and the third line will give me 1 integer. But the second line can give me any number of integers ranging between 1 to 100. For example, the input could be:</p>
  
  <pre><code>2 1
  5 6 1 9 2
  10
  </code></pre>
  
  <p>or could be:</p>
  
  <pre><code>10 4
  5 6
  9
  </code></pre>
  
  <p>I can read the second line of integer input into an integer array for a fixed number of integers, but cannot do so for a varying number of integers. I suppose, in this case, I should use a while loop which will break when <code>scanf()</code> finds a newline. How do I code that?</p>