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
Web résumés allow you to include extra graphics and images that you would not include in a traditional résumé. please select the
SVETLANKA909090 [29]

A web resume is better than a traditional resume because it contains images or photographs.

<h3>What is a web resume?</h3>

A web resume is defined as a resume that is read by a computer program that summarizes the information of each employee. It is a virtual resume that is used by the company to take information about the person.

Web resume contains the data such as their education, skills, job experience, languages, and so on.

Thus, the photo of the project or internship that has been done in past can be shown on the web resume by uploading the certificate on the computer system along with the resume.

For example, the company takes the information of the person on their server before the interview.

More about the web resume link is given below.

brainly.com/question/862477

8 0
1 year ago
What type of malware is heavily dependent on a user in order to spread?
frosja888 [35]
The answer is " Virus" !
5 0
3 years ago
Create a PHP page that contains an array of at least 20 movie titles or book titles (your choice). The HTML page should have an
ella [17]

Answer:

This is the code

Explanation:

<html>

<form method="POST" action="welcome.php">

label for="usname">username:</label><br>

<input type="text" id="usname" name="usname"><br>

<label for="movietitles">Movietitles</label><br>

<textarea type="text" id="movetitle" name="movietitles">Please enter movie titles</textarea>

<input type="submit">

</form>

</html>

<?php

$Movietitles= array("bland", "decoy","Mademan", "Rich", "bland", "decoy","Mademan", "Rich", "bland", "decoy","Mademan", "Rich" , "bland", "decoy","Mademan", "Rich, "decoy","Mademan", "Rich", "Adapt" );

$username= $_POST['username'];

if (!empty($_POST['username'])) {

$username = $_POST['username'];

echo "Welcome";

}

?>

The post method HTTP request is used to send the data from the form to the Welcome.php file above so that it validates/tests that username has been entered using the php if statement and if it is not empty(entered username) php "echos" welcome to the screen.

5 0
3 years ago
Java: Literal representing the true value ? In java, what is the literal that represents a true value ?
Tema [17]
1 is what represents a true value and 0 is a negative value
4 0
2 years ago
A new company will have 40 workstations in one building sharing a single network. All users must be able to share ¬les and print
kobusy [5.1K]

Answer:

Domain Networking.

Explanation:

A domain in networking refers to any group of workstation,users,printers devices ,database servers and computers which share different type of data via resources of network.

Hence domain networking will be the best option for the company having 40 workstation in a single building sharing a single network.

6 0
3 years ago
Other questions:
  • You can combine the algorithms for converting between infix to postfix and for evaluating postfix to evaluate an infix expressio
    13·1 answer
  • The program used to create the file where you want to insert the object is called the ____.
    12·1 answer
  • FIGURE A-2—Use the information in this chart to answer Question 2.
    11·1 answer
  • __________ is a growing practice in cooperative farmingassociations to pool and sell the fruit as a common commodity underthe br
    6·1 answer
  • Can you give an example of mail merge (letter) pls​​
    6·1 answer
  • How many sets of number do both Hex and RGB values have?
    10·1 answer
  • What is the benefit of hosting a website on a personali
    6·1 answer
  • Im a beginner programmer. what languages should i learn and how do i get better
    13·1 answer
  • Data elements in a relational database are organized into ____
    15·1 answer
  • What are some of the characteristics found in an editorial photograph?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!