Computer Science, asked by akshitchaudhary852, 11 months ago

write how to generate random no.​

Answers

Answered by Raunak1432
0

Explanation:

For example: A Random number between 0 and 100. value = rand() * 100; A Random true or false. decision = (rand() > .5); A Random number between 50 and 100. x = (rand() * 50) + 50; A Random integer between 1 and 10. To get an integer from a floating point value we can use functions such as round or ceil or floor.

Answered by Anonymous
1

Answer:

Computers can generate truly random numbers by observing some outside data, like mouse movements or fan noise, which is not predictable, and creating data from it. This is known as entropy. Other times, they generate “pseudorandom” numbers by using an algorithm so the results appear random, .

mark it as a brainlist answer

Similar questions