title: Difference between scanf("%79[^\n]",line); vs scanf("%79[^\n]\n",line) vs scanf("%79[^\n]s",line)
body: <p>I was writing a program in c to read the contents of a file.
  The code is as follows: </p>
  
  <pre><code>   #include&lt;stdio.h&gt;
     void main()
     {
     char line[90];
     while(scanf("%79[^\n]\n",line)==1) 
     printf("%s",line);
     }
  </code></pre>
  
  <p>The above code reads a file content and displays it on the screen.</p>
  
  <p>But </p>
  
  <pre><code>while(scanf("%79[^\n]",line)==1) and while(scanf("%79[^\n]s",line)==1) or while(scanf("%79[^\n]s\n",line)==1) 
  </code></pre>
  
  <p>doesn't work.(They display only the first line)</p>
  
  <p>Can anyone explain?</p>