Question: int find _ min ( int x , y ) { int min = 0 ; if ( x < y ) { min =

int find_min(int x, y){ int min =0; if (x < y){ min = x; } else { min = y; } return min; }
What is the error in the following function definition?
int find_min(int x, y){ int min =0; if (x < y){ min = x; } else { min = y; } return min; }
The function returns the maximum instead of the minimum of the two arguments.
The function does not specify a type for the second parameter variable.
The function returns 0 if the first and second arguments are equal.
The function does not return a value.

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!