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
The source Host A is going to send 5KB (5120byte) of data to the destination Host B over an established TCP connection, which ha
NISA [10]

Answer:

the answer is d have a nice day

Explanation: i got a 100

3 0
2 years ago
Name and describe the various features of the PC support pages of About.com.
erma4kov [3.2K]

Answer: Awnser below.

Explanation:

Basically, what you're going to need for a computer from my basic knowledge is a motherboard, of course, this is so you can actually use your computer. You'll need a PSU, or so called, a power supply. This will give power to your motherboard and the other components with it. You will need a CPU, this is basically the brains of the computer. This will run your operating system, and main componets. A GPU, this will give you a display for your monitor. And of course, ram. Ram will be giving you display for your monitor, and for running tasks.

For more components, you would need a hard drive, or an SSD, which will store your files and operating system. And of course, a keyboard, mouse, and monitor.

7 0
3 years ago
Read 2 more answers
1) Which of the following would you NOT see on a Windows 10 Start menu?
Sati [7]
Task view

I hope this helps you :)
3 0
2 years ago
What is the newest iphone?
OlgaM077 [116]

xR max is the newest iPhone out right now

7 0
2 years ago
Read 2 more answers
You are asked to develop a cash register for a fruit shop that sells oranges and apples. The program will first ask the number o
vaieri [72.5K]

Answer:

customers = int(input("How many customers? "))

for i in range(customers):

   name = input("Name of Customer " + str(i+1) + " ")

   

   print("Oranges are $1.40 each.")

   oranges = int(input("How many Oranges? "))

   

   print("Apples are $.75 each.")

   apples = int(input("How many Apples? "))

   

   bill = oranges * 1.4 + apples * 0.75

   

   print(name + ", you bought " + str(oranges) + " Orange(s) and " + str(apples) + " Apple(s). Your bill is $%.1f" % bill)

Explanation:

*The code is in Python.

Ask the user to enter the number of customers

Create a for loop that iterates for each customer. Inside the loop, ask the user to enter the name, number of oranges, number of apples. Calculate the bill. Print the name, number of oranges, number of apples bought and total bill

5 0
3 years ago
Other questions:
  • If r is an instance of the above Person class and oddNum has been declared as a variable of type boolean, which of the following
    8·1 answer
  • "PindCart, an online retailer, places a small file on the computer hard drive of its visitors to recognize them when they revisi
    7·1 answer
  • You have just changed the system time within your computer's BIOS. You choose to save the settings upon exit. What happens next
    14·2 answers
  • MIDI is a A.technology based on placing brief digital recordings of live sounds under the control of a synthesizer keyboard. B.t
    10·1 answer
  • The___provides access to the internet; may also be internal
    11·1 answer
  • How many pieces can be connected on to a to an SPS​
    11·1 answer
  • With a heat exchanger, the temperature of the process fluid can be measured with a temperature-
    14·1 answer
  • How should excel Identify social security numbers: as a text, numbers, or date and time? Why?
    11·2 answers
  • Which three options below describe typographic hierarchy?
    12·1 answer
  • Data mining requires specialized data analysts to ask ad hoc questions and obtain answers quickly from the system. select one: t
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!