title: How to coordinate lines of input into related arrays
body: <p>so i have this program which asks the user to provide as input from the command line an artist name. At most 4 artists can be provided as input. For each artist, at least 1 and at most 3 songs could be provided. the issue i have is when i print the artists and playlist out, i keep getting some random symbols as output and no words. im not sure whats the mistake here. can someone help or direct me in some direction? (i know the program isnt done, i just wanted to get this working first)         </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include "sortAndShuffle.h"
  
  
  int main(void)
  {
      //The array containing artists names
      char artists[4][80];
      //The array containing the sorted artists
      char sortedArtists[4][80];
      //Songs for Artist 1
      char songsArtist1[3][80];
      //Songs for Artist 2
      char songsArtist2[3][80];
      //Songs for Artist 3
      char songsArtist3[3][80];
      //Songs for Artist 4
      char songsArtist4[3][80];
      //The total number of artists (Note it can be less than 4)
      int numOfArtists =0;
      //The total number of songs for each artist (Note that less than 3 songs can 
      be provided for each artist)
      int numSongsPerArtist[4];
  
      int i,j;
  
      /*
      * Use here functions that you should implement to insert artists and songs 
      from the standard input.
      * Note that you also need to track the number of artists and the number of 
      songs for each artist.
      */
      for(i=1; i&lt;=1; i++) {
          printf("Insert artist/group name");
          fgets(artists[i], 80, stdin);
  
          for(j=1; j&lt;=3; j++) {
              if(i==1) {
                  printf("Insert song %d for %s",j,artists[i]);
                  fgets(songsArtist1,80,stdin);
              }
              if(i==2) {
                  printf("Insert song %d for %s",j,artists[i]);
                  fgets(songsArtist2,80,stdin);
              }
              if(i==3) {
                  printf("Insert song %d for %s",j,artists[i]);
                  fgets(songsArtist3,80,stdin);
              }
              if(i==4) {
                  printf("Insert song %d for %s",j,artists[i]);
                  fgets(songsArtist4,80,stdin);
              }
  
          }
          if(artists[i][0] !=' ' &amp;&amp; artists[i][1] !=' ') {
              numOfArtists
          }
      }
  
      for(i=1; i&lt;=4; i++) {
          printf("%s\n", artists[i]);
          for(j=1; j &lt;=3; j++) {
              if(i==1) {
                  printf("%s",songsArtist1[j]);
              }
              if(i==2) {
                  printf("%s",songsArtist2[j]);
              }
              if(i==3) {
                  printf("%s",songsArtist3[j]);
              }
              if(i==4) {
                  printf("%s",songsArtist4[j]);
              }
          }
      }
  
      /*
      * Use here the function sortArtists to sort the array of the artists and sortSongs to sort the songs of each artist
      * Print each artist (alphabetically) and for each of them print the list of songs sorted alphabetically
      */
  
      /*
      * Use here the function shuffleSongs to shuffle all the songs
      * Print the list of shuffled songs
      */
      return 0;
  }
  </code></pre>