Given the following function definition for a search function, and the following
ID: 3937419 • Letter: G
Question
Given the following function definition for a search function, and the following variable declarations, which of the following are appropriate function invocations?
const int SIZE = 1000;
int search(const int array[ ], int target, int numElements);
int array[SIZE], target, numberOfElements;
result = search(array[0], target, numberOfElements);
search(array[0], target, numberOfElements);
result = search(array, target, numberOfElements);
result = search(array, target, SIZE);
result = search(array[0], target, numberOfElements);
search(array[0], target, numberOfElements);
result = search(array, target, numberOfElements);
result = search(array, target, SIZE);
Explanation / Answer
Answer is result = search(array, target, SIZE);
array holds the array
target holds the target value that needs to be search
SIZE holds the size of array
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.