title: file doesn,t found in c language when i use goto label to again run code without exiting from the output
body: <p>When i run this code it runs perfectly but when it again comes to label and than 5 files does not found after that i again come from label than all files does not found</p>
  
  <pre><code>void main()
  {
  
      int i,a;
  
      char filepath[100],filename[100];
  
      FILE *fp;
  
      clrscr();
  
      label:
  
      clrscr();
      printf("Press 1:");
      scanf("%d",&amp;a);
  
      if(a==1)
      {
          for(i=1;i&lt;10;i++)
          {
              sprintf(filename,"%d",i);
              strcat(filename,".txt");
  
              fp=fopen(filename,"r");
              if(fp==NULL)
              {
                  printf("File not found!!\n");
              }
              printf("%s\n",filename);
  
          }
          getch();
      }
      else
      {
          exit(0);
      }
      fclose(fp);
      goto label;
  }
  
  </code></pre>