Module Example
Public Sub Main()
Dim rnd As New Random()
Console.WriteLine("20 random integers from -100 to 100:")
For ctr As Integer = 1 To 20
Console.WriteLine(rnd.Next(-100, 101))
Next
Console.WriteLine()
Console.WriteLine("20 random integers from 1000 to 10000:")
For ctr As Integer = 1 To 20
Console.Write(rnd.Next(1000, 10001))
Next
Console.WriteLine("20 random integers from 1 to 10:")
For ctr As Integer = 1 To 20
Console.Write(rnd.Next(1, 11))
Next
End Sub
End Module
7.36.Random |
| 7.36.1. | Random.Next(Int32, Int32) generates random integers with three distinct ranges. |