int main()
{
 FILE*arq;
 char a[500];
  int i,f;
  arq=fopen("test.txt","w+");
 for(i=0;i<5;i++){
  printf("Type the name:");
  fgets(a,500,stdin);
  fprintf(arq,"%s",a);
  printf("Enter the age");
  fscanf(arq,"%d", f);
  fprintf(arq, "%d", f);
 }
fclose(arq);
return 0;
}
I cannot put the name and age in the file because after typing the name it skips the typing of the age
 
     
     
     
    