Question: Problem 1-50 points Write a function called showIndex() that takes as parameters an array, its size and a value of type integer. The function must

 Problem 1-50 points Write a function called showIndex() that takes as

Problem 1-50 points Write a function called showIndex() that takes as parameters an array, its size and a value of type integer. The function must search for the value in the array and then output the index of each array elements equal to that value. For example, if the first parameter is an array that contains (1.7,5,8,7,3,7,6} the second parameter size is 8, and the third parameter is a value equal to 7. The function must print 1,3 and 6 since 7 exists at these three array indices. Write a main function that declares an array of 8 integers and asks the user to (1) fill the array elements, and (2) enter any integer k. The program calls the above function to show the indices of the array elements where integer k exists. Sample Run: Enter an integer: 1 Enter an integer: 7 Enter an integer: 5 Enter an integer: 8 Enter an integer: 7 Enter an integer: 3 Enter an integer: 7 Enter an integer: 6 please enter value of k: 7 7 occured at index 1 7 occured at index 4 7 occured at index 6

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!