Question: [esus) lab8 1. the quick brown fox jumps over the lazy dog doe lazy the over jumps fox brown quick the N is a number



[esus) lab8 1. the quick brown fox jumps over the lazy dog doe lazy the over jumps fox brown quick the N is a number provided via command-1ine argument. Details Requirements Take in a single command-line argument. o Print an error message if not enough or too many program arguments o Convert it to an integer print error and quit if entered less than 0) Read in that many lines from standard input o For each line, scan the entire line using fgets. Implement a function to reverse the words in the line. and call it on every input line. o he words must appear in reverse order. but still readable from left to right. o NOTE: Punctuation and extra spaces should be omitted in the reversed string Print out the reversed line Command-line argument Command-une arguments are a way for you to provide input to the program at the moment it is executed. For this program, you will use a single command-line argument to provide the number of lines to be read from standard input. as an integer greater than or equal to zero. Convert ing to int To obtain the value ofN from this command-line argument, you must convertit to an int. Use the function strtol to accomplish this. With the call to strtol ou must provide the base of the number returned. In our case. we want a standard base 10 number returned. In addition, you will need to use type casting to convert the result of the function back into an int. int N (int) strtol st NULL 10 NOTE: Be sure to include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
