Write a program that asks the user for the name of a file. The program should display

Question:

Write a program that asks the user for the name of a file. The program should display only the first five lines of the file’s contents. If the file contains fewer than five lines, it should display the file’s entire contents.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: