title: Changing the scanf() delimiter
body: <p>My objective is to change the delimiter of <code>scanf</code> to "<code>\n</code>".
  I tried using <code>scanf("%[^\n]s",sen);</code> and works fine for single inputs.
  But when i put the same line inside a <code>for</code> loop for multiple sentences it gives me garbage values.</p>
  
  <p>Does anyone know why?</p>
  
  <hr>
  
  <p>Here's my code:</p>
  
  <pre><code>char sen[20];
  for (i=0;i&lt;2;i++)
  {
      scanf("%[^\n]s",sen);
      printf("%s\n",sen);
  }
  </code></pre>