#this program is not running why???

4 messages · Page 1 of 1 (latest)

mint geode
#

public class array {
public static int largest_number(int number[]) {
int largest = Integer.MIN_VALUE;

    for (int i = 0; i <= number.length; i++) {
        if (largest < number[i]) {
            largest = number[i];
        }
    }
    return largest;
}

public static void main(String[] args) {
    int number[] = { 1, 2, 3, 5, 64, 89 };
    System.out.println(largest_number(number));
}

}

gloomy barnBOT
#

This post has been reserved for your question.

Hey @mint geode! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

mint geode
#

please find error