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
Which of the following is the best definition of a computer code? a secret language a mathematical language a language that comp
Fudgin [204]

Answer:

a language that computers use

Explanation:

Coding can come in many different forms but it is all used on the computer and then translated.

6 0
3 years ago
Read 2 more answers
Your company is instituting a new security awareness program. You are responsible for educating end users on a variety of threat
muminat

Answer:

Using the skills of the people to acquire the proprietary information

Explanation:

Because the proprietary information is considered as the secret of the trade that an organization or the company wants to keep hidden from the other companies. So, that's why when we instituting or installing the new awareness program, we have to cautious about the threats while educating the end-users.

7 0
4 years ago
Which statement is true of Web-based electronic data interchange (Open EDI)? a. It consists of international agreements on priva
ale4655 [162]

Answer: (B) It reduces the cost of transmitting documents

Explanation:

 The web based EDI (Electronic data interchange) is one of the simplest technique for transmitting the various types of documents by using the EDI system.

In the web based electronic data exchange, we exchange the file or document by using the web forms in the internet browser.

The main advantage of the web based EDI system is that it reduces the overall cost during the transmission of documents. The EDI system is basically bases on the SAAS (Software as a service) principle and it is widely used in the business.

Therefore, Option (B) is correct.

6 0
3 years ago
Based on current and upcoming gaming technologies, what changes do you expect to see in the next generation of gaming consoles?
damaskus [11]
Better graphics getting 1080 p easily running on 240 frames and a higher storage so then you could have more games on the console
4 0
3 years ago
Which of the following best describes the protocols used on the Internet?
max2010maxim [7]

Answer:

D: The protocols of the Internet are open and used by all devices connected to the network

Explanation:

There are billions of devices connected to the Internet, and hundreds of different kinds of devices: laptops, tablets, phones, refrigerators, handheld credit card readers, and so on. Protocols (standards) ensure that the variety of devices interact with each other smoothly.  There are a lot of protocols! The Internet was designed with several layers of abstraction that sort the protocols according to what part of the process they support.

5 0
3 years ago
Other questions:
  • Provide Java code to illustrate how to create an array, reference an array, and address an element of an array.
    13·1 answer
  • Josh's boss asked him to write a letter to their customers explaining some upcoming price increases. But Josh was in a hurry to
    8·2 answers
  • You have a small business.Due to the recent pandemic you seem to be losing contacts with your suppliers and customers.You want t
    10·1 answer
  • What is the difference between an activity inventory and an object inventory?
    8·1 answer
  • Explain the three schemes via which the binding of instructions and data to memory addresses can be done. In each scheme, how th
    13·1 answer
  • What is the output of the following JavaScript code?
    9·1 answer
  • What programming language does the LMC 'understand'?
    5·1 answer
  • 2. Explain the difference between a JMP instruction and CALL instruction
    6·1 answer
  • State whether the given HTML coding is True or False. &lt;HR SIZE=5 COLOR=YELLOW ALIGN=RIGHT WIDTH=75%&gt;​
    9·1 answer
  • Describe the specific job you would want to have if you were going to pursue a career in digital music or video.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!