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
When conducting research on the internet, what is a starting point for determining how to start the research?
Alex787 [66]
It depends on what you're researching for.
4 0
3 years ago
What does "CPU" stand for?
sergiy2304 [10]
Central Processing Unit
8 0
3 years ago
Read 2 more answers
Do you think the governmentshould allocate moremoney to HIV/AIDS orphans​
inna [77]

Answer:

Abstract

Objective Through a descriptive study, we determined the factors that influence the decision-making process for allocating funds to HIV/AIDS prevention and treatment programmes, and the extent to which formal decision tools are used in the municipality of KwaDukuza, South Africa.

Methods We conducted 35 key informant interviews in KwaDukuza. The interview questions addressed specific resource allocation issues while allowing respondents to speak openly about the complexities of the HIV/AIDS resource allocation process.

4 0
3 years ago
Three periods after a menu item (…) mean that clicking that command will open
otez555 [7]
<h2>Answer:</h2>

Option B: a dialog box

Three periods after a menu item (…) mean that clicking that command will open a dialog box.

<h2>Explanation:</h2>
  • The three periods after items in menus are given a special name "ellipsis".
  • As the space for an item name is less for complete description, ellipsis is used.
  • Ellipsis lead to dialog box that elaborates the function of the item.
  • The person can then select the item depending on the need as well as reject it completely.
  • So in other words, ellipsis allow users to understand the command completely and choose what to do next.

<h3>I hope it will help you! </h3>
8 0
4 years ago
Non proprietary standard is also termed as____________
Tju [1.3M]

Answer: Option A) De facto standard

Non proprietary standard is also termed as de facto standard.

Explanation:  Non proprietary standard is also termed as de facto as when the proprietary standard such as window are widely used, then it becomes  de facto standard. When de facto standard is referring in terms of computers, it is an accepted application, design or language standard that is used in industry but not officially recognized.  

An example of de facto standard is paper clip ion used in e-mail to represent an attachment.  

7 0
4 years ago
Other questions:
  • What are the 5 general terms of the fair use rule
    9·1 answer
  • You are the IT administrator for a small corporate network. Recently, you added a web server that runs services that need to be
    12·1 answer
  • What outline feature can the Navigation pane browse the document by?
    14·2 answers
  • A descriptive study represents the highest level on the knowledge-level continuum.
    11·1 answer
  • A customer contacts the help disk stating a laptop does not remain charged for more than 30 minutes and will not charge more tha
    10·1 answer
  • Which computer was part of the first generation of computers?
    14·2 answers
  • The welcome screen of the program 123D consists of ___
    15·1 answer
  • PLEASE HELP ME!!!
    13·1 answer
  • Cloud architects have been largely replaced by ScrumMasters.<br><br> True<br><br> False
    15·2 answers
  • Which of the following statements about recommendation engines is TRUE?A: An online recommendation engine is a set of algorithms
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!