subject

Write a program findStr. c that finds the "smallest" and "largest" in a series of words. After the user enters the words, the program will determine which words would come first and last if the words were listed in dictionary order. The program must stop accepting input when the user enters a four-letter word. Assume that no word is more than 20 letters long. An interactive session with the program might look like this: Enter word: dog Enter word: zebra Enter word: rabbit Enter word: catfish Enter word: walrus Enter word: cat Enter word: fish Smallest word: cat Largest word: zebra Hint: Use two strings named smallest_word and largest_word to keep track of the "smallest" and "largest" words entered so far. Each time the user enters a new word, use strcmp to compare it with smallest_word; if the new word is "smaller", use strcpy to save it in smallest_word. Do a similar comparison with largest_word. Use strlen to determine when the user has entered a four- letter word.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 15:20
What does a bonus object do? a. subtracts lives b. keeps track of a player's health c. gives a player an advantage d. makes text appear
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
Which of the following is not an enhancement to the standard wiki to make it more attractive for corporations? encryptionwork spacespermission toolspredictive text
Answers: 2
question
Computers and Technology, 23.06.2019 22:40
22. sata3 allows for data transfer rates of 600 mb/s. explain why you would likely not be able to copy data from one hard drive to another at anywhere close to this speed. also, what could be upgraded on the computer to achieve transfer speeds closer to 600 mb/s
Answers: 1
question
Computers and Technology, 24.06.2019 07:00
Why would a business likely use a java applet - to back up their data files for the business - to create a program that a customer can launch in their web browser - to create music on a powerpoint presentation - to organize files on their company directory
Answers: 3
You know the right answer?
Write a program findStr. c that finds the "smallest" and "largest" in a series of words. After the u...
Questions
question
Mathematics, 14.09.2020 17:01
question
Mathematics, 14.09.2020 17:01
question
Mathematics, 14.09.2020 17:01
question
Mathematics, 14.09.2020 17:01
question
Mathematics, 14.09.2020 17:01
question
Mathematics, 14.09.2020 17:01
question
Mathematics, 14.09.2020 17:01
question
History, 14.09.2020 17:01
question
Mathematics, 14.09.2020 17:01
question
Mathematics, 14.09.2020 17:01
question
Chemistry, 14.09.2020 17:01
question
English, 14.09.2020 17:01
question
Mathematics, 14.09.2020 17:01
question
Mathematics, 14.09.2020 17:01
question
Chemistry, 14.09.2020 17:01
question
Social Studies, 14.09.2020 17:01
question
Biology, 14.09.2020 17:01
question
Mathematics, 14.09.2020 17:01
question
English, 14.09.2020 17:01
question
Mathematics, 14.09.2020 17:01
Questions on the website: 13722361