Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started