I need to generate a random number that has 4 digits, but I have to make sure that every digit is not higher than 6, Is it possible? if so, how can I do that? :) (In C)
need to generate a random number, but every digit in that number can't be higher than 6 (in C)
50 views Asked by Stav At
1
Simplest option would be to generate 4 different random numbers in the range of 0 to 6, then add them up, but multiply the first one by 1, second one by 10 etc.