jolletevazquez4472 jolletevazquez4472
  • 08-03-2018
  • Computers and Technology
contestada

What is the possible output from system.out.println((int)math.random() * 4)?

Respuesta :

keu
keu keu
  • 22-03-2018
int randomWithRange(int min, int max) {
    int range = (max - min) + 1;
    return (int)(Math.random() * range);
}

Output of randomWithRange(2, 5) 5 times:

3 0 1 1 0

Answer Link

Otras preguntas

By introducing Hinduism to the Indus River valley, the Aryans played a similar role to whom in the Mayan civilization?
Why are the Vedas important to Hindus?
The sum of twice a number b and 3 is 18.
3x-7y=17   when x=-3,0,3
Greenhouse gases are essential to support life on earth. True or false?
what is 63.4721 to 1 decimal place
YW bisects <XYZ. m<XYW=(2x+7) and m<XYZ= (6x-8). find the value of the X and the measure of <XYZ
Sudan is omitted from inclusion in the Sub-Saharan region because it
Solve equation for y. 2/5x+y=7
What was one reason why groups of early humans rarely stayed in one place for very long?