//Reads three numbers from the file infile.dat, sums the numbers, //and writes the sum to the file outfile.dat. //(A better version of this program will be given in Display 5.2.) #include int main() { ifstream in_stream; ofstream out_stream; in_stream.open("infile.dat"); out_stream.open("outfile.dat"); int first, second, third; in_stream >> first >> second >> third; out_stream << "The sum of the first 3\n" << "numbers in infile.dat\n" << "is " << (first + second + third) << endl; in_stream.close(); out_stream.close(); return 0; }