Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

find smallest number in an array

static int SmallestNumberin(int[] numbers){
            int smallestNumber = numbers[0];
            for (int i = 1; i < numbers.Length +1; i++)
            {
                if(numbers[i] < smallestNumber){
                    smallestNumber = numbers[i];
                }
            }
            return smallestNumber;
        }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #smallest #number #array
ADD COMMENT
Topic
Name
8+8 =