0
How to generate five 2- digit random number?
My code is generating 5 random numbers, but it is also generating 1- digit random number. Here is my code: for i in {1..5} do echo $(( ( RANDOM% 99 )+100 )) done
3 ответов
+ 1
I'm not familiar with shellscript, but looking at how you do it, it looks like C rand() call. In C, the following generates random number between 10 and 99 (two digits). Perhaps you can try it with shellscript too.
rand() % 90 + 10;
+ 1
Thank you Ipang. Even I tried the same solution after a few researches.
+ 1
Good luck Prithvi
Keep trying ... 💪