Question: Lab 09 Arrays Objective To practice using Arrays Task Write a Program that performs searching a value in an Array. Initially ask user how many

Lab 09 Arrays

Objective

To practice using Arrays

Task

Write a Program that performs searching a value in an Array. Initially ask user how many values they want to store in an Array. Read values from the keyboard and store it in the array. Then ask the user to ask for the keys (values) to search. Then display all the index values where each of the key is found.

Use the following function and call it from main.

Void searchKey(int valuesArray[], int size1,int keysArray[],int size2) Sample Output 1 : Console How many value do you want to store in the Array ? 5 How many keys do you want to search ? 2 Enter all the values separated by spaces 10 20 30 5 2 Enter the keys separated by a space 5 10 Sample Output: 5 found at index 3 10 found at index 0. Sample Output 2 : Console How many value do you want to store in the Array ? 5 How many keys do you want to search ? 2 Enter all the values separated by spaces 10 20 30 5 4 Enter the keys separated by a space 51 Sample Output 2: 5 found at index 3

1 found at index -1.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!