Explanation:-
First we have to create a file with extension (like .txt) after that by using the program we have to print the file in console screen. Always remember we have to read the file by line by line and also write the file sum line by line in another file name Sum.txt and one more thing file should be in the same folder in which our program already exists. We can give the file name in console screen so no need to give the filename in a program. So basically we have to take an input from one file and after the sum, we have to write the output in another file line by line. After the end of the program, one file will be created open the file you get the sum of the input file.
Input:
Output:
file created successfully go to sum.txt file and open
File Output:

need an explanation for this answer? contact us directly to get an explanation for this answer