title: Scan and print full names in a list (C language)
body: <p>I want to create a C program that can read 'n' number of full names from keyboard input and print them. I tried to use <code>fgets()</code>, but couldn't figure out how to scan multiple entries, so I ended up writing the code below. </p>
  
  <p>The issue is, it takes the names as input and just prints garbage values.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;conio.h&gt;
  #include &lt;string.h&gt;
  
  int main()
  {
      int n,i;
      char name[64][64],sur[15][15],a[3];
  
      printf("How many names? ");
      scanf("%d",&amp;n);
      printf("\nEnter names:\n");
  
      for(i=0;i&lt;n;i++)
      {
          scanf("%s%s",name[i],sur[i]);
      }
  
      for(i=0;i&lt;n;i++)
      {
          a[3]=' ';
          strcat(name[i],a);
          strcat(name[i],sur[i]);
      }
  
      printf("\nThe names are:\n");
      for(i=0;i&lt;n;i++)
      {
          printf("%s",name[i]);
      }
      getch();
  
      return 0;
  }
  </code></pre>