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
One easy way to tell if a cell contains a formula instead of data is to click on the cell and look at the formula bar to
joja [24]

Answer:

E

Explanation:

i know

3 0
2 years ago
Read 2 more answers
It is a study that aims to gather data to get the particular view,belief, or opion of a group of respondents about a specific is
k0ka [10]
B. Online survey hope this helps
5 0
3 years ago
_____ is a higher-level, object-oriented application interface used to access remote database servers
makkiz [27]
RDO.

RDO uses the lower-level DAO and ODBC for direct access to databases.
7 0
1 year ago
Most IT security threats originate with hackers.<br> Question 3 options:<br> True<br> False
kap26 [50]
The answer is True they do originate with hackers
6 0
3 years ago
A computer that delivers requested web pages to your computer or mobile device is a(n) _____.
yaroslaw [1]

Answer:

Web Server

A web server is server software, or hardware dedicated to running this software, that can satisfy client requests on the World Wide Web. A web server can, in general, contain one or more websites. A web server processes incoming network requests over HTTP and several other related protocols.

6 0
3 years ago
Other questions:
  • Perform online or offline research to learn more about film elements. Then, write a short report on the essentials of filmmaking
    13·1 answer
  • In an advanced word processing program which type of image or graphic is available in a variety of formats and styles?
    12·2 answers
  • IN MICROSOFT EXCEL YOU CAN UES FOMULA TO DIVIDE OR MULTIPLY WHAT IS THE CORRECT FORMULA TO CALCULATE 4*6
    14·1 answer
  • Now tell me how be rich like Bill Gates
    6·1 answer
  • shapes polymorphism Create a set of classes derived from an abstract class Shape, which provides a common interface, for managin
    7·1 answer
  • For this project you will write a Java program that will run a simple math quiz. Your program will generate two random integers
    15·1 answer
  • Businesses and sometimes individuals use a _____ to assimilate all of their social media content on a specific topic to engage r
    13·1 answer
  • A technician is building a thick client workstation that would be used to run a database and wants to ensure the best protection
    12·1 answer
  • Reading a news release about a product is an example of <br> research.
    9·1 answer
  • Which of the following component is required to insert text in multimedia
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!