Write a program that reads a file prompt user for the input


Write a program that reads a file (prompt user for the input file name) containing two columns of integers. Print the sum of each column. Use a loop to read the data from the file. 

Use the following data for the input file:

20 10     1

25 100   2

35 200   3

25 1000  4

The output should be:

The sums are 105, 1310, and 10.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Write a program that reads a file prompt user for the input
Reference No:- TGS02511777

Now Priced at $10 (50% Discount)

Recommended (95%)

Rated (4.7/5)