/* * Solution Template for Addition * * This file is provided to assist with reading and writing of the input * files for the problem. You may modify this file however you wish, or * you may choose not to use this file at all. */ #include int a; int b; int answer; int main(void) { /* Open the input and output files. */ FILE *input_file = fopen("addin.txt", "r"); FILE *output_file = fopen("addout.txt", "w"); /* Read the values of a and b from the input file. */ fscanf(input_file, "%d%d", &a, &b); /* * TODO: This is where you should add the numbers. Store the sum into the * variable answer. */ /* Write the answer to the output file. */ fprintf(output_file, "%d\n", answer); /* Finally, close the input/output files. */ fclose(input_file); fclose(output_file); return 0; }