- I need to randomly select 10 numbers from 1-100 and store them in an array. Random_number(101) selects a number in range 0 <= number < 101 but zero must be excluded.
I could make some piece of code to check if the selected number is zero:
for (iNumber= 1 ; iNumber <=10 ; iNumber ++)
iNumberArray[iNumber] = random_number(101);
while ( iNumberArray[iNumber] == 0 ) iNumberArray[iNumber] = random_number(101); }
I need then to check these 10 numbers to be different for each other. If there are equal numbers, it should re select different ones
Finally I need to short them from the lower to the higher number
Basically, I’d like to ask some help for 2 and 3.