title: Scanning until new line
body: <p>I want to read all the text entered until a new line character is entered.</p>
  
  <p>This is my code.</p>
  
  <pre><code>int i=0;
  char ch[MAX];
  printf("Enter the text\n");
  while(true)
  {
       scanf("%c",&amp;ch[i]);
       if(ch[i]=='\n')
           break;
       i++;
  }
  </code></pre>
  
  <p>But when I try to execute it reads only one word.</p>
  
  <p>I have also tried <code>scanf("%s",ch);</code> but the result is the same.</p>