How to know which random number come | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to know which random number come

<phpstart $rand=rand(1,3); $result = 24/$rand; echo $result; phpend>

20th Jan 2021, 7:10 AM
DEEPAK KEWALRAMANI
DEEPAK KEWALRAMANI - avatar
4 Answers
+ 2
DEEPAK KEWALRAMANI Random number will generate from 1 to 3. You can't guess which random number will come.
20th Jan 2021, 9:36 AM
A͢J
A͢J - avatar
+ 1
DEEPAK KEWALRAMANI Read the challenge question again. There is given which is not possible output. So output will be 6. Explanation: Random number maybe 1 or 2 or 3 so 1 - $result = 24 / 1 = 24 2 - $result = 24 / 2 = 12 3 - $result = 24 / 3 = 8 These are possible output but 6 is not possible output
21st Jan 2021, 6:53 AM
A͢J
A͢J - avatar
+ 1
I Am AJ ! Oh thx ♥✌
25th Jan 2021, 6:09 PM
DEEPAK KEWALRAMANI
DEEPAK KEWALRAMANI - avatar
0
I Am AJ ! I answer 12 but its not correct! The correct answer is 6 how?
21st Jan 2021, 5:30 AM
DEEPAK KEWALRAMANI
DEEPAK KEWALRAMANI - avatar