#include #include #include int main() { char c; FILE *fpin, *fpout; if((fpin = fopen("input1.txt", "r")) == NULL){ fprintf(stderr, "Failed to open: input1.txt\n"); exit(1); } if((fpout = fopen("output1b.txt", "w")) == NULL){ fprintf(stderr, "Failed to open: output1b.txt\n"); fclose(fpin); exit(2); } while(fscanf(fpin, "%c", &c) == 1){ printf("%c", c); fputc(c, fpout); } fclose(fpin); fputc('\n', fpout); if((fpin = fopen("input1.txt", "r")) == NULL){ fprintf(stderr, "Failed to open: input1.txt\n"); fclose(fpout); exit(3); } while(fscanf(fpin, "%c", &c) == 1){ fputc(tolower(c), fpout); } fclose(fpin); fclose(fpout); return 0; }