Programming Assignment

Command-line Arguments & Strings

 

Write a program that finds the "smallest" and largest" in a series of words on the command line.  The program will determine which words would come first and last if the words were listed in dictionary order.  You can assume that no word is more than 20 letters long.  For example, running the program by typing:

findlargandsml dog zebra rabbit catfish walrus cat fish

should produce the following output:

Smallest word: cat
Largest word: zebra

Hint: You will need to use strcmp() and strcpy(). 

Use my example as one of your examples to test with. 

You will need to hand in the program and output (make sure I can see what's typed on the command line).