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 get the octal value of the given number in vbscript?

0 Answers  


How to create MSAcess table foriegn key

1 Answers  


What is dictionary object in vbscript? Explain?

0 Answers  


Hi I don't have any idea on VBscript. can any one point me to a good web site to learn VBscript. Regards lina

2 Answers  


What are the 2 ways to pass a value to the function?

0 Answers  






How to return only alpha bate string from an string str = "bibhu@#$%&das&*)(SUndar"

4 Answers   Cap Gemini,


Program to use input box and send even numbers into sheet1 and odd numbers into sheet2 and prime numbers into sheet3 using vbscript(QTP)?

0 Answers   Tech Mahindra,


which is the bset training centre to learn automation tools?

2 Answers  


Mention the environments where vbscript could be run?

0 Answers  


How can the spaces from the string be removed?

0 Answers  


Which keyword is used to declare a variable in the vbscript language?

0 Answers  


Check whether given Number is Even or Odd?

2 Answers   HDFC,


Categories