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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started