title: How to take string input in different lines?
body: <p>I wanna take some strings as input in 5 different lines.There is no limit about how many words a line can contain.But I want 5 lines.How can I do it?Please help me.</p>
  
  <p>Example:The program will be like the following one</p>
  
  <pre><code>How many Line?
  
  5
  
  Enter 5 line:
  
  hi i am john
  
  i am new to c programming.
  
  in have problem in string.
  
  i can not take input
  
  pleas help me.thanks a lot.
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code> #include&lt;stdio.h&gt;
   int main()
   {
      int line,i;
      char *string;
      printf("How many line?\n");
      scanf("%d",&amp;line);
      for(i=0;i&lt;line;i++)
      {
          gets(string);
      }
      printf("You entered:\n");
      for(i=0;i&lt;line;i++)
      {
        puts(string);
      }
      return 0;
   }
  </code></pre>
  
  <p>In my code it is just taking (n-1) line.Like if i give line 4 it takes 3 line and print the only the last line for 4 times.How can I solve this?</p>