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
Anna35 [415]
3 years ago
9

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

he 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. For example, if the input is 4 hello zoo sleep drizzle z The output should be Zoo To achieve the above, first read the list into a vector. Keep in mind that the character 'a is not equal to the character 'A
Computers and Technology
1 answer:
guapka [62]3 years ago
6 0

Answer:

/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
Which of the following is a social news-sharing service?
Vsevolod [243]

Answer:

Reddit

Explanation:

Just google reddit and click the website and you can basically find everything there.

7 0
3 years ago
Read 2 more answers
2.
Masja [62]

Answer:

is this a question or not?

6 0
3 years ago
What is one benefit of using electronic flash cards?
velikii [3]

Answer:

They can be searched using keywords. they may have a different alarm settings. they provide a personal organizer.

Explanation:

Hope this helped Mark BRAINLIEST!!!

4 0
3 years ago
Read 2 more answers
The ___________________ command is used to establish connectivity.
schepotkina [342]
The PING command is used to establish connectivity
4 0
3 years ago
The fall of the Berlin Wall and the emergence of a way to find things on the Web through the Netscape browser were two that was
Romashka-Z-Leto [24]
<h2>Answer:</h2>

Option 4. a way for software to communicate and become interactive

is the correct answer.

<h2>Explanation:</h2>

<h2>The fall of the Berlin Wall and the emergence of a way to find things on the Web through the Netscape browser were two that was browser were two events that flattened the world. A third platform was needed to change the world and that was a way for software to communicate and become interactive.</h2><h2 />

This question belongs to the advent of software and technology that has made world a global village. The factors that played important roles are Fall of Berlin wall and Netscape browser.

The third thing the added to connectivity among people is the production of softwares like Skype and other social applications that made it easier for people to interact with other and communicate faster.

<h2>i hope it will help you!</h2>
5 0
3 years ago
Other questions:
  • What microprocessor was the first to be processable<br> ?
    14·1 answer
  • In a CPMT, a(n) ____ should be a high-level manager with influence and resources that can be used to support the project team, p
    10·1 answer
  • To close the ____ view, click File on the Ribbon or click the preview of the document in the Info gallery to return to the docum
    9·1 answer
  • Lisa is modifying a spreadsheet. Which view will allow Lisa to see how her changes will look when she prints the spreadsheet?
    13·2 answers
  • Apple's macOS and Microsoft Windows are examples of ________ software. utility application communication operating system
    13·1 answer
  • If we want to access files located in a directory on a remote server, which of these options would we use?
    9·2 answers
  • Drag the right word to it’s definition
    13·1 answer
  • Where can a client identify the instant deposit options for their QuickBooks Payments account?
    5·1 answer
  • Ok so I’m using a word document and towards the bottom of the page it stops me from moving my text box any further down even tho
    13·2 answers
  • _is the joining of two or more electrical conductors by mechanically twisting the conductors together or by using a special spli
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!