title: How can I use the "gets" function many times in my C program?
body: <p>My code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  int main()
  {
      int t;
      scanf("%d",&amp;t);
      while(t--)
      {
          char a[10],b[10];
          puts("enter");
          gets(a);
          puts("enter");
          gets(b);
          puts("enter");
          puts(a);
          puts(b);
      }
      return 0;
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>1
  
  enter 
  
  enter
  
  surya  (string entered by user)
  
  enter
  
  surya   (last puts function worked)
  </code></pre>