Answer:
Explanation:
The following program is written in Python. It asks the user for the file name (which needs to be in the same directory as the program) and reads the file. It then splits it by lines and saves it into an array. Then it loops through the array, printing each line with its corresponding line number.
file_name = input("File Name: ")
f = open(file_name, 'r')
lines = f.read().split('\n')
for line in lines:
print(str(lines.index(line) + 1) + ': ' + line)