Question: Please help me to figure out how to make this program run in eclipse java with a class file, and no errors. int CompareSmallestNumber (int
Please help me to figure out how to make this program run in eclipse java with a class file, and no errors.
int CompareSmallestNumber (int array[ ])
{ int x, curMin;
// set smallest value to first item in array curMin = array[0];
/* iterate through array to find smallest value and also assume there are only 10 elements
*/
for (x = 1; x < 10; x++)
{
if( array[x] < curMin) {
curMin = array[x];
}
}
// return smallest value in the array return curMin;
}
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
