C Programming: Write a program called tail.c that prints out the last N lines of a given file 1. Nam

C Programming:

Write a program called tail.c that prints out the last N lines of a given file

1. Name your executable tail.out

2. Arguments to your program will be passed on the command line in the

following order

A. Name of the file

B. N

3. N will always be at least 1

4. If N is greater than the number of lines in the file, all of the lines in the file

should be displayed

5. You may assume that no line is longer than 100 characters

6. There is no limit to the number of lines in a file

7. Some lines may only contain the newline character, these still count as a line

8. Some editors automatically add 1 newline character to the end of most of

the test files but does not display them so do be aware that they are there.

Example. Assume the file test.txt contains the following

This

is

a test!

1../tail.out test.txt 1

a test!

2../tail.out test.txt 2

is

a test!

3../tail.out test.txt 10

This

is

a test!

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer