Final answer:
To solve this problem, you can read an integer, a list of words, and a character. Then, iterate through each word and check if the character is present in the word. If the character is found, print the word.
Step-by-step explanation:
To solve this problem, you can follow these steps:
- Read the integer that represents the number of words in the list.
- Read the list of words into an array.
- Read the character that needs to be searched.
- Iterate through each word in the array and check if the character is present in the word.
- If the character is found in the word, print the word.
Here's an example code that implements this logic:
#include <stdio.h>
int main() {
int numWords;
scanf("%d", &numWords);
char words[20][10];
for (int i = 0; i < numWords; i++) {
scanf("%s", words[i]);
}
char searchCharacter;
scanf(" %c", &searchCharacter);
for (int i = 0; i < numWords; i++) {
if (strchr(words[i], searchCharacter)) {
printf("%s\\", words[i]);
}
}
return 0;
}