Question: What does this function do ? int mystery ( double employees [ ] , double id , int size ) { for ( int i

What does this function do?
int mystery(double employees[], double id, int size){ for (int i =0; i < size; i++){ if (id == employees[i]){ return i; }} return -1; }
Group of answer choices
This is a function that performs a search. If the id is found in the employees array, its index location is returned, otherwise -1 is returned.
This is a function that returns all index numbers in the employees array, one at a time. Once the entire array has been processed, -1 is returned.
This is a function that swaps the value in the id variable with the value in the employees array at index i. If the swap cannot be performed, -1 is returned.
This is a function that sorts the employees array

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 Programming Questions!