| Author |
Generating random numbers
|
David JonesK
Greenhorn
Joined: Mar 11, 2004
Posts: 6
|
|
hi, i'm really stuck, can anyone tell me how to generate random numbers between 100 and 200 in java. thank you
|
 |
john smith
Ranch Hand
Joined: Mar 04, 2004
Posts: 75
|
posted

0
|
This would do it:
|
 |
Vicken Karaoghlanian
Ranch Hand
Joined: Jul 21, 2003
Posts: 522
|
|
I want to add one more thing... Although John's code is correct, 200 is never reached, the closest number you will get is 199.999...
|
- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. <br />- What truth? <br />- That there is no spoon!!!
|
 |
David JonesK
Greenhorn
Joined: Mar 11, 2004
Posts: 6
|
|
|
Thanks
|
 |
john smith
Ranch Hand
Joined: Mar 04, 2004
Posts: 75
|
posted

0
|
|
Fair point Vicken - I hadn't noticed that.
|
 |
 |
|
|
subject: Generating random numbers
|
|
|