Question: Write a well-commented C program that accepts the name of a file and a field-number from the user, and then reads that file and for

Write a well-commented C program that accepts the name of a file and a "field-number" from the user, and then reads that file and for each line in that file prints on the terminal word at position "field-number" and also writes the word into an output file. For example, if the input file as the following lines:

C is a programming language.

lex produces a lexical analyser

cc is a compiler

and if the field-number specified is 4, then the output of the program is:

programming

lexical

(NULL) compiler

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!