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
Rus_ich [418]
3 years ago
14

in c Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the li

st. The output of the program is every word in the list that contains the character at least once. Assume at least one word in the list will contain the given character. Assume that the list will always contain less than 20 words. Each word will always contain less than 10 characters and no spaces.
Computers and Technology
1 answer:
Fiesta28 [93]3 years ago
3 0

Answer:

see explaination

Explanation:

//Include required header file.

#include <stdio.h>

//Define the function isWordContainChar() having the

//required parameters.

int isWordContainChar(char* req_word, char search_char)

{

//Declare required variable.

int i;

//Start a for loop to traverse the string given in

//the function parameter.

for(i = 0; req_word[i] != '\0' ; i++)

{

//If the current character in the gievn word is

//matched with the character which needs to be

//found in the word, then return 1.

if(req_word[i] == search_char)

{

return 1;

}

}

//Otherwise, return 0.

return 0;

}

//Start the execution of the main() method.

int main(void)

{

//Declare the required variables.

int num_words, index, word_index;

char str_word[20][10];

char searchCharacter;

//Prompt the user to enter the number of words.

scanf("%d", &num_words);

//Prompt the user to enter the required words using a

//for loop and store them into an array.

for(index = 0; index < num_words; index++)

{

scanf("%s", str_word[index]);

}

//Prompt the user to enter a required character which

//needs to be found in a word.

scanf(" %c", &searchCharacter);

//Traverse the words stored in the array using a for

//loop.

for(index = 0; index < num_words; index++)

{

//Call the function isWordContainChar() with

//required arguments in rach iteration and if the

//value returned by this function is not 0, then

//display the current string in the array.

if(isWordContainChar(str_word[index],

searchCharacter) != 0)

{

printf("%s\n", str_word[index]);

}

}

return 0;

}

You might be interested in
Travelers should keep their profile information up-to-date. which is not an option for a traveler to update their own profile in
Komok [63]

After logging onto DTS, on the Welcome screen, hover over Traveler Setup and select Update Personal Profile.

<h3>What is Setup?</h3>

Setup is the arrangement of something, or a competition when the winner is already known because the two competitors are not evenly matched. The setup of food and beverages at a party is an illustration of a setup. A setup might involve pairing a strong debater with a weak debater.

Whether we like it or not, US English spellings have a significant influence on a lot of our language today. Therefore, the phrase "setup" is used when discussing the start of computer programs, but in all other contexts, the words "to set up" and "the set-up" are used instead.

Informal. an endeavor or competition that is made purposefully simple. a game or contest where the opponent can be easily defeated without risk or effort.

To learn more about Setup from the given link:

brainly.com/question/25736513

#SPJ4

4 0
2 years ago
How is knowing how to use word or docs importamt?
ollegr [7]
For 90% of users, the word processing capabilities of Google Docs is more than enough. But for some, Microsoft Word's advanced features will be important. ... You also get far more powerful templates, which could speed up your work, depending on what you use Word for.
3 0
3 years ago
“What does it mean when we “rework” copyrighted material?”
Alja [10]
We use ideas and thoughts that have already been protected by the law which is called Copyright. We reworking copyright material means we are taking somebody's ideas and calling it ours. Which is not right by the law.
3 0
3 years ago
Read 2 more answers
Dereck works for long hours on his computer. He frequently experiences physical strain by the end of the day because he does not
Anni [7]
I think the answers are B and D!
4 0
3 years ago
Read 2 more answers
You have been tasked with ensuring that access to certain server managed resources is only available to client devices with TPM
elixir [45]

Answer:

Device Health Attestation Services

Explanation:

Based on the scenario being described it can be said that the Windows Server role that can be used to automate this check is known as Device Health Attestation Services. This is a role that allows the administrator to automatically check if a device has the required trustworthy BIOS, TPM, or boot software enabled, as well as Bitlocker encryption.

7 0
3 years ago
Other questions:
  • How can i add card reader to pc answers?
    9·1 answer
  • What office application has animations on the home ribbon?
    7·2 answers
  • If your network subnet mask is /16, what is the maximum number of host ids available for this network?
    15·1 answer
  • Powerpoint assumes that the first slide in a new presentation is the
    10·1 answer
  • What is meant by polling mode in communication between software andUART and what is its disadvantage as compared to interrupt mo
    14·1 answer
  • . What is the relationship between frequency, wavelength and speed of a wave?
    15·1 answer
  • Please tell fast plzzzzzzz​
    11·1 answer
  • Your team has provisioned an Auto Scaling Groups in a single Region. The Auto Scaling Group at max capacity would total 40 EC2 i
    14·1 answer
  • Why is quantum computing potentially a better fit for weather forecasting than classical computers?.
    8·1 answer
  • What service determines which resources a user can access along with the operations that a user can perform?.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!