title: Reading multiple lines of input with scanf
body: <p>Writing a program for class, restricted to only scanf method. Program receives can receive any number of lines as input. Trouble with receiving input of multiple lines with scanf.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main(){
      char s[100];
      while(scanf("%[^\n]",s)==1){
          printf("%s",s);
      }
      return 0;
  }
  </code></pre>
  
  <p>Example input:</p>
  
  <pre><code>Here is a line.
  Here is another line.
  </code></pre>
  
  <p>This is the current output:</p>
  
  <pre><code>Here is a line.
  </code></pre>
  
  <p>I want my output to be identical to my input. Using scanf.</p>