title: Simple C Program User Enters 5 Names of Friends
body: <p>The parameters of the program are described as follows: Create a program that allows a user to enter up to five names of friends. Use a two dimensional array to store the friends’ names. After each name is entered, the user should have the option to enter another name or print out a report that shows each name entered thus far.</p>
  
  <p>My issue has been that it will store a two word name as two separate names, and additionally print the menu option twice. I can't seem to figure this one out so any help would be appreciated.</p>
  
  <p>Here's the code: </p>
  
  <h1>include </h1>
  
  <pre><code>int main(void)
  
  {
  char  cName[5][21]= {0};
  int x=0;
  int  iPick;
  
  
  printf("Enter the name of 5 people\n\n");
  
  
  for(x=0;x&lt;=5;x++){
  printf("Enter name %d:", x+1);
  scanf("%s", cName[x]);
  
  
  
  printf("\n\nWould you like to add another name or view current names stored?\n");
  printf("1)\tAdd another name\n");
  printf("2)\tView names stored\n");
  scanf("%d", &amp;iPick);
  switch(iPick){
  case 1:
      break;
  case 2:
      for(x=0;x&lt;=5;x++){
      printf("\nName %d is %s\n",x+1, cName[x]);
          }
  }
  }
  return 0;
  }
  </code></pre>