-
December 7th, 2011, 11:03 AM
#1
Need help with arrays
So im trying to find the min number in an array. Seems simple but I keep getting an error
Here is my code.
private int findMin(int numbers[]) {
//PRE numbers.length >= 1
int min = numbers [0];
for (int i = 0; i > numbers.length; i++); {
if (numbers [i] < min) {
min = numbers [i];
}
}
return min;
}
I keep getting the error (cannot find symbol - variable i). Am I missing something. Would greatly appreciate any help
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|