1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nadusha1986 [10]
3 years ago
9

Write a program findStr.c that finds the "smallest" and "largest" in a series of words. After the user enters the words, the pro

gram 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.

Computers and Technology
1 answer:
stich3 [128]3 years ago
6 0

Answer:

Check the explanation

Explanation:

C code:

#include<stdio.h>

#include<string.h>

#include<stdlib.h>

int main()

{

char input[21],smallest_word[21],largest_word[21];

printf("Enter Word : ");

scanf("%s",input);

strcpy(smallest_word,input);

strcpy(largest_word,input);

while(strlen(input)!=4)

{

if(strcmp(input,smallest_word)<0)

strcpy(smallest_word,input);

else if (strcmp(input,largest_word)>0)

strcpy(largest_word,input);

printf("Enter Word : ");

scanf("%s",input);

}

printf("Smallest word : %s\n",smallest_word);

printf("Largest word : %s\n",largest_word);

return 0;

}

You might be interested in
Display the Approval Form worksheet and create an IF statement in cell B13 to determine if the applicant is eligible for a perso
zhuklara [117]

Excel formulas are expressions used to perform computation.

The Excel formula to enter in cell B13 is =IF(B9 < 600, "Denied","Approved)

From the question, we have:

  • Cell B13 represents the applicant's eligibility status
  • Cell B9 represents the credit score

The eligibility criteria are given as:

  • Credit Score < 600 = “Denied”
  • Credit Score >= 600 = “Approved”

To write the formula, we make use of an IF function

An IF function in Microsoft Office Excel has the following syntax

=IF([condition],[value if true],[value if false]).

So, the required formula to enter in cell B13 is:

=IF(B9 < 600, "Denied","Approved)

Read more about Excel formulas at:

brainly.com/question/25683602

4 0
3 years ago
Given two integer variables matricAge and gradAge, write a statement that gives gradAge a value that is 4 more than the value of
Natasha_Volkova [10]

Answer:

gradAge=matricAge+4;//Statement to give gradAge a value 4 more than matricAge.

Explanation:

This statement assigns the value stored in the matricAge variable with 4 added to it.So the value assigned to the gradAge is 4 more than value of matricAge.We have used assignment operator(=) to do this.Assignment operator assigns the value/variable's value written in the right to the variable to the left.

8 0
3 years ago
What is meant by usability and what characteristics of an interface are used to assess a system’s usability?
ahrayia [7]

Answer:

The answer is below

Explanation:

Usability is a term that describes the assessment of the performance of a system in assisting the task of the user, or how effective a certain product system or design supports the task of a user in accomplishing a set out objective as desired.

The characteristics of an interface that are used to assess a system’s usability are:

1. Effectiveness

2. Efficiency

3. Error Tolerance

4. Engagement

5. Ease of Learning and Navigation

3 0
3 years ago
Which set of variables will make code easier to understand?
Alecsey [184]

Answer:

sum, price, count

Explanation:

Programmers should use significant names for the variables.

Not only it makes it easier for them to remember what kind of information is stored in each variable, but it also makes life simpler for anyone who would read the code later.

Names like sum, price and count are significant names ( assuming they actually hold this kind of data), and will make the re-reading of the program code much easier.

8 0
3 years ago
outline how the appropriate features that may be used to ensure that the document is free of spelling and grammatically errors.​
aivan3 [116]

Answer:

Answer

Since Sophie often makes a lot of

grammatical and spelling errors in her

document, it might be best for her to use

a feature available in Microsoft Word that

would help her better in understanding

what her mistakes are, which is

something that (D) Explain does.

Explain would tell Sophie which part of

her sentence is wrong, or what word

did she mistype, and what better way to

phrase a sentence to avoid fragmented

ones.

6 0
3 years ago
Other questions:
  • When might it be necessary or advisable to write a shell script instead of a shell function? give as many reasons as you can thi
    15·1 answer
  • A network that operates without relying on a server is the ________ network.
    6·1 answer
  • What systemctl command configures a unit to start the next time the computer boots?
    10·1 answer
  • (A) writer or word <br> (B) Calc or Excel <br> (C) impress or PowerPoint<br> (D) none of these
    14·1 answer
  • With a chart , illustrate the stage of wood processing plsss help I will mark u as brainliest plss help pls and I will follow yo
    15·1 answer
  • is there anybody out there who is a social butterfly like me? If so then you can tlk to me on this. and to anybody out there tha
    12·1 answer
  • Meghla has brought a smartphone with length is 4 unit and breadth is 3 unit, what is the screen size of the smartphone
    12·2 answers
  • What machine learning technique helps in answering the question
    8·1 answer
  • Can i get some help please .
    5·2 answers
  • Any correct answers will be helpful.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!