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]
2 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]2 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
BRAINLIEST !!A game design document is like a diary for game developers.
mafiozo [28]
The answer is true. A game design document is like a diary for game developers.
5 0
2 years ago
Select the properties of the sn1 reaction mechanism.
musickatia [10]

It is - not stereospecific , a reaction in which the stereochemistry of the reactants controls the outcome of the reaction; - bimolecular at rate-determining step , it involves two molecules; - first order, - rates is governed by the stability of the carbocation that is formed.

7 0
2 years ago
How does a router handle a packet destined for a network that is not listed in the routing table?
kogti [31]
The packet is dropped or discarded. By default, a router will send packets to a network that has been listed in the routing table. If it happens that the network is not listed, the packet will be discarded or dropped. Packets that do not have a default route or gateway of last resort are dropped.

 






5 0
3 years ago
provides an automated method for discovering host systems on a network. Although it doesn't necessarily discover all weaknesses,
Oxana [17]

Answer:

Network scan

Explanation:

Cyber security can be defined as preventive practice of protecting computers, software programs, electronic devices, networks, servers and data from potential theft, attack, damage, or unauthorized access by using a body of technology, frameworks, processes and network engineers.

Some examples of cyber attacks are phishing, zero-day exploits, denial of service, man in the middle, cryptojacking, malware, SQL injection, spoofing etc.

Generally, a security assessment is carried out by network security experts on a regular basis to determine potential loopholes or vulnerabilities in the information and technology (IT) infrastructure. One of the techniques or approach used in security assessment is a network scan.

A network scan is a security assessment technique used for the automatic detection of host systems on a network. Although a network scan isn't capable of discovering or detecting all the weaknesses on a network, it avails users information about the computer systems that are active on the network and what services the computer systems offer or what ports are available on them.

3 0
3 years ago
Which of the following are characteristics of conditional formatting? Choose all that apply.
Leona [35]
Formatting that is selected for each cell individually related to a specific condition
8 0
3 years ago
Read 2 more answers
Other questions:
  • Match the tool to its description.
    15·1 answer
  • Given that the array monthSales of integers has already been declared and that its elements contain sales data for the 12 months
    6·1 answer
  • Tell me the shortcut keys used in Ms PowerPoint ?​
    6·2 answers
  • A ____ database supports data distributed across several different sites.
    7·1 answer
  • Create a conditional expression that evaluates to string "negative" if userVal is less than 0, and "non-negative" otherwise. Ex:
    11·1 answer
  • A_______ to show the working of an object before it is built or made. A. Prototype b. Test c. Evaluation d. Plan
    10·1 answer
  • Select three advantages of cloud computing.
    10·1 answer
  • What is the computer system cycle called?
    13·1 answer
  • My computer is being weird, Everytime I begin to type something on here it keeps adding a letter to the beginning of my sentence
    8·1 answer
  • Mack signs into his laptop and gets a message saying all his files have been encrypted and will only be released if he sends mon
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!