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

helpppppppppppppppp 88 points
Who were Sacco and Vanzetti? What happened to them? Why did it happen?
Name one social condition that people used Social Darwinism to justify.
Aside from the area in the map, desertification is an issue in other parts of the world EXCEPT Map outlining the African Sahel in a light brown color. the Unite
What is area of the irregular figure below? 6in 4in 12in
6. Contrast the leadership styles of Dolores Huerta and Cesar Chavez.
why is compromise especially important in government
(x - 3)2 – 4 = x2 - 6x +
Which sentence uses the antonym of the following word? subversion A. Elliott has an extreme dedication to his job as a police officer. B. Emma was sly and got a
Skin cancer: The mole is many different shades of brown or black asymmetry border color diameter evolving