Hi, you will need to create an array filled with the desired numbers. You will then need to sort the array, checking for which elements are larger than the others.
Here is a code snippet that demonstrates this but before jumping straight to the answer, have a go at coding it yourself
Rem ***** Main Source File *****
sync on : sync rate 60
randomize timer()
// create an array to hold numbers
dim array(10)
// a variable to hold a value while a swap is being performed
temp as integer
// give the elements of the array random values
print "Array before sorting"
for n = 1 to 10
array(n) = rnd(10)
print array(n) // print the array
next
print
// print and sort the array
print "Array after sorting"
// sort in ascending
for b = 1 to 9
for n = 1 to 9
if array(n) > array(n+1)
temp = array(n)
array(n)= array(n+1)
array(n+1)=temp
endif
next n
next b
// display the sorted array
for n = 1 to 10
print array(n)
next n
// refresh the screen
sync
wait key
end
A clever person solves a problem, a wise person avoids it - Albert Einstein