#include #include int main() { FILE *fPtr; char name[20]; int age; printf("Please enter your name (max 19 characters): "); scanf("%s", name); printf("Hello, %s, what is your age? ", name); scanf("%d", &age); printf("Storing results to output file . . . "); if ((fPtr = fopen("output.file", "a")) != NULL) { fprintf(fPtr, "%s %d\n", name, age); printf("done.\n"); fclose(fPtr); } else { fprintf(stderr, "ERROR writing output file.\n"); exit(1); } return(0); }