Given the following function definition for a search functio
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); |
Solution
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
