Write a program that inputs 9 characters from the user and storethem in an array
ID: 3614348 • Letter: W
Question
Write a program that inputs 9 characters from the user and storethem in an array. Then search in this array for a key characterentered by the user, if the character is found, the program shouldspecify the index of the element in the array. Use the followingmodel:
a. The main() function enters the 9 charactersand stores them in the array, prompt the user for the keycharacter, and calls the search() method to search for thecharacter. It also prints the search result to the user.
b. The search() function receives the array,the size of the array, and the key character to search for asparameters and searches for the key. It returns the index of thefound character or -1 if not found.
Explanation / Answer
#include int search(int array[], int size, int n) { int i=0, ret = -1; for(i=0; iRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.