Tuesday, 23 June 2020

23 - Web Designing Question - 03

The Rnd statement will generate a(n)?

(A)    decimal value between 0.01 and 1.00

(B)    integer value between 0.01 and 1.00

(C)    decimal value between 0.0 and 1.0

(D)   decimal value between 0.0 and up to 1.0, but not including 1.0



The Rnd function returns a random number. The number is always less than 1 but greater or equal to 0.

Syntax

Rnd[(number)]

Number is an optional parameter

If number is:

<0 - Rnd returns the same number every time

>0 - Rnd returns the next random number in the sequence

=0 - Rnd returns the most recently generated number

Not supplied - Rnd returns the next random number in the sequence

 

<script type="text/vbscript">

document.write(rnd(0) & "</br>")

document.write(rnd(5) & "</br>")

document.write(rnd(0.5) & "</br>")

document.write(rnd() & "</br>")

</script>

  

So Ans is 
(D)   decimal value between 0.0 and up to 1.0, but not including 1.0
 

No comments:

Post a Comment