Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

find the largest number from an array

static int LargestNumberin(int[] numbers){
            int largestNumber = numbers[0];
            for (int i = 1; i < numbers.Length +1; i++)
            {
                if(numbers[i] > largestNumber){
                    largestNumber = numbers[i];
                }
            }
            return largestNumber;
        }
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #find #largest #number #array
ADD COMMENT
Topic
Name
3+3 =