line 27 - did you mean to reverse these? The random number generated is always between 1 and 9, so always less than 20 in smallestNUMBER. You're assigning 20 to each element of the array but I think you meant to update the smallestNUMBER variable so it doesn't output 20 at the end?
for if statement I know that random number wont be bigger than 9, so I used one random big number in this example 20. in if array if smallsetNUMBER is bigger than array[i] then smallestNUMBER should take array[i] .