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, 22.06.2019 22:40
In this lab, you complete a python program that calculates an employee's annual bonus. input is an employee's first name, last name, salary, and numeric performance rating. if the rating is 1, 2, or 3, the bonus rate used is .25, .15, or .1 respectively. if the rating is 4 or higher, the rate is 0. the employee bonus is calculated by multiplying the bonus rate by the annual salary.
Answers: 1
question
Computers and Technology, 23.06.2019 08:30
All of these are true about using adhesive except: a. dissimilar materials can be joined. b. mixing tips are product and material specific. c. a specific application gun may be required. d. two-part adhesives are dispensed using two mixing tips
Answers: 3
question
Computers and Technology, 24.06.2019 04:30
How do you share someone else’s tweet with your own twitter followers?
Answers: 1
question
Computers and Technology, 24.06.2019 21:40
Assume you need to test a function named inorder. the function inorder receives three int arguments and returns true if and only if the arguments are in non-decreasing order: that is, the second argument is not < the first and the third is not < the second. write the definition of driver function testinorder whose job it is to determine whether inorder is correct. so testinorder returns true if inorder is correct and returns false otherwise. for the purposes of this exercise, assume inorder is an expensive function call, so call it as few times as possible!
Answers: 1
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, 11.06.2020 21:57
question
English, 11.06.2020 21:57
question
Mathematics, 11.06.2020 21:57
Questions on the website: 13722363