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 are important for protecting computing devices and systems? Physical safeguards like a secure space prote
Elenna [48]

Answer: All of the above

Explanation:

All the above listed point serves as security measures to safeguard our computing devices and systems.

4 0
3 years ago
What is a generic phone
Zina [86]

Explanation:

Generic Android Device means the Android devices which does not any specific brand name or they can not be related to any specific class or brand. For ex: Samsung developed Epic 4g Touch Android device but they later removed lot of fancy features and stuffs from it launched with Galaxy S.

3 0
2 years ago
Read 2 more answers
40 POINTS PLZ HELP NEED ASAP!!!
dem82 [27]
I Think The answer is c I hope it helps Message Me if I’m wrong and I’ll change My answer and fix it for you
7 0
3 years ago
You use the ____ operator to reverse the meaning of a boolean expression.
charle [14.2K]
!  actually it means not, which reverses a boolean.
8 0
3 years ago
Around the world, various brands of personal computers are sold with Pentium processors. This fact is often used as a selling po
natta225 [31]

Answer:

Co-branding.

Explanation:

Around the world, various brands of personal computers are sold with Pentium processors. This fact is often used as a selling point, with advertising that proclaims "Intel Inside." Co-branding concept do such advertising.

6 0
2 years ago
Other questions:
  • Quick question how the internet has impacted y’all life ? 5 sentences or more
    8·2 answers
  • WILL MARK BRAINLYIST
    15·2 answers
  • Code a call to the function anotherFunc passing the array myints.
    15·1 answer
  • HURRY UP !!!!!!’<br> Each packet is addressed to the recipient's .
    8·1 answer
  • Loops are frequently used to ____; that is, to make sure it is meaningful and useful.
    12·1 answer
  • Please list ten things that you have learned an Excel Spreadsheet can do.
    7·1 answer
  • Which memory can be removed from motherboard? RAM OR ROM?​
    11·1 answer
  • 2. Which pattern microphone should Jennifer take to the press conference? Jennifer is a journalist with one of the leading newsp
    14·1 answer
  • Defination of formula work sheet​
    15·1 answer
  • Types of Hazards Mitigation Measures
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!