از اين فرمول:
کد:
Int (Rnd * (HighBound - LowerBound)) + LowerBound
LowerBound: حد پايين
HighBound: حد بالا
کد:
Dim LowerBound, HighBound, Area As Integer
LowerBound = InputBox("Enter Lower Bound:", "Lower Bound of Area")
HighBound = InputBox("Enter High Bound:", "High Bound of Area")
Area = HighBound - LowerBound
Print Int(Rnd * Area) + LowerBound
Area محدوده هستش.