BasicallyIzzy8161 BasicallyIzzy8161
  • 01-07-2021
  • Computers and Technology
contestada

What will be the range of the random numbers generated by the following code snippet? rand() % 50 + 5;

Respuesta :

isabellarw123
isabellarw123 isabellarw123
  • 02-07-2021

Answer:

Between 5 to 54

Answer Link
fichoh
fichoh fichoh
  • 02-12-2021

The function given would generate random number in the range 5 to 54.

  • The rand() function is used C++ to generate random values with a given range.

  • The value, 5 in the function, represents the least value in the range.

  • The maximum value in the range can be calculated as (50 + 5) - 1 ;

  • This means that the maximum value in the range would be (55 - 1) = 54.

Hence, the range of value generated would be (5, 54)

Learn more : https://brainly.com/question/22841107

Answer Link

Otras preguntas

What is two thirds of 120?
Write y= 3/4x + 1/2 in standard form. Thanks in advance. Also, could you please briefly explain how you did it, because these questions confuse me. Thank you. A
the 42 foot tree casts a shadow of 63 feet. how long is a shadow of a 5 foot girl who is standing near it
All of the following are true about Latinos’ experiences in World War II EXCEPT (A) unlike African Americans, Latinos fought in integrated units (B) Latino you
how do I round 3.047 to the nearest hundred and show the math
what are some fun facts on animal and plant cells.
What conditions must be met in order for a reaction to be considered exothermic?
What is the coefficient of x in the expression x-2? Explain your reasoning.
what are some fun facts on animal and plant cells.
Containment was a policy in which the U.S. tried to do what?