Question: Write a program that copies itself and adds line numbers to each line. assume constant file names. First, open the file in read mode, then
Write a program that copies itself and adds line numbers to each line. assume constant file names. First, open the file in read mode, then open the copy file in write mode. After that, line by line, get the lines from the source file, append the number of the line to the destination file, and append the line content. Remember to close both files. Check that both files have been successfully opened. If one of the fopen functions fails, then print the message: "Error opening a file."and end the program
C using stdio.h
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
