Thursday, 19 June 2014

Rnd function:-The Rnd function will generates a pseudo-random number

Syntax:-

Rnd(Number)

The Rnd function will generates a pseudo-random number greater than or equal to 0.0 and less than 1.0.

before using rnd function we have to declare Randomize Function

Example:

Randomize
Rnd()
Output:
0.1414095

Example 2:-

Randomize
upperlimit = 150000.0
lowerlimit = 10000.0
Int((upperlimit - lowerlimit + 1)*Rnd() + lowerlimit)
Output:
13366

No comments:

Post a Comment