how to genarate a random numbers in vb?

Answers were Sorted based on User's Feedback



how to genarate a random numbers in vb?..

Answer / cnu

Function Random(max,min)
Randomize
Random=Int((max-min+1)*Rnd+min)
End Function

Dim A
A = random(100,1)
msgbox ("The random numer is:" &A)

Is This Answer Correct ?    2 Yes 0 No

how to genarate a random numbers in vb?..

Answer / swamireddy

to genarate random numbers in vb using the random fuction
the fuction systax for
function Random(Lowerbound As Long, Upperbound As Long)
Randomize
Random = Int(Rnd * Upperbound) + Lowerbound
End Function
this fuction use automatically genarate a random numbers.
how to call the fuction.
a=random(lowerbound,upperbound)

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More VB Script Interview Questions

How will you compare two strings in vbscript?

0 Answers  


write a vb script to generate fibonnaci numbers

1 Answers  


What are the rules to name variable in vbscript?

0 Answers  


Which event is triggered when mouse focus comes out of an element in the vbscript language?

0 Answers  


Explain about scrrun.dll?

0 Answers  


How will you get a string with the specified character the specified number of times in vbscript?

0 Answers  


Hi, Anybody could tell me What is the script for Reverse of Given number. Ex:236--632. Thanks in Advance..

10 Answers   Amazon, CSC,


How to Enter Values on the Command promt using VB script

0 Answers  


i wrote vbscripit code in notepad i got error i am in learning stage if u ps tell me what wrong in my code my error is "object required descriptive at line one run time error"and my code is "set usernameobj=Descriptive.Create() usernameobj( "name").value="Username" set passwordobj=Descriptive.Create() passwordobj("name").value="password" set signinobj=Descriptive.Create() signinobj("name").value="sigin" browser("gmail").page("gmail").WebEdit("usernameobj").set ("enter username") Browser("gmail").Page("gmail").WebEdit("passwordobj").Set secure.Crypt.Encrypt("enter password") browser("gmail").page("gmail").WebButton("siginobj").click

0 Answers  


how to find greatest of n numbers!

3 Answers   Syscon,


There are 5 web pages.write a script to click the button on 4th web page.

0 Answers   Accenture,


What is Querystring collection?

0 Answers  


Categories