Print the first 5 lines of a file (lastnameHEAD.c). Write a C program that takes a file as an argument and prints its first 5 lines (equivalent to using head -n 5). If this program does not receive the correct number of arguments, or if it fails to open the given file, it should return errors. Hint: Write a function readLine that reads characters until it hits a newline character - run this function in a loop to get and print 5 lines. Assume that the file has at least 5 lines.
High stat
Modification
Distribution of the file.
HEAD
Figure 1 - Expected behavior of lastnameHEAD