title: My case 2 doesnt seem to be reading my .txt files in C programming
body: <p>I've been working on this program for my job that I'm trying to make an inventory of tools. I'm very new to programming if there is an alternative rout to take on this I'm open to looking in to it.</p>
  
  <p>My first case works. All it does is ask the user for a nomenclature, part number(P/N), and serial number (S/N).</p>
  
  <p>The second case I'm trying to make it print the list of data.</p>
  
  <p>My goal for this is to get my problem fixed for my second case</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  
  main()
  {
  FILE * fp;
  int qty;
  int menu;
  char nomen[26];
  char pN[26];
  char ans;
  //Test to see if file exist
  fp = fopen("Metro Inventory.txt", "w");
  if (fp == NULL)
  {
      printf("*Error opening file*");
      fprintf(fp,"*Error opening file*");
      exit(1);
  }
  //Intro Header
  fprintf(fp,"List of Special Tools:");
  fprintf(fp,"\t\t\tPart Number:");
  fprintf(fp,"\t\t Quantity:\n\n");
  
  printf("Metro Aviation Tools List\n\n");
  printf("What would you like to do?\n");
  scanf("%d", &amp;menu);
  //loop of switch asking for nomenclature
  do
  {
      switch (menu)
      { //Case 1 adds new content
          case(1):
          {
          printf("Enter Nomenclature(no spaces):\n");
          scanf("%s", nomen);
          fputs(nomen, fp);
          fputs("\t\t\t",fp);
  
          //Part Number
  
          printf("What is the part number?\n");
          scanf("%s", pN);
          fputs(pN, fp);
          fputs("\t\t\t", fp);
          //Quantity
          printf("What is the quantity?\n");
          scanf("%d", &amp;qty);
          fprintf(fp,"%d",qty);
          fputs("\n", fp);
          break;
          fclose(fp);
          }// Case 2 Edits content
          case(2):
          {
  
          int c;
  
                  fp = fopen("Metro Inventory.txt", "r");
                  if (fp) 
                      {
                      while ((c = getc(fp)) != EOF)
                          putchar(c);
                      fclose(fp);
                      }
  
              fclose(fp);
              break;
          }
          default : printf("Thank you");
          break;
      }//end switch
      printf("To add tool type Y.\n To exit type N.\n");
      getch();
      scanf("\n%c", &amp;ans);
  //loop
  }
  while ((ans == 'Y')||(ans == 'y'));
  if ((ans == 'N')||(ans=='n'));
  {
      exit(1);
  
  }
  </code></pre>
  
  <p>getch();</p>
  
  <p>return 0;
  }</p>