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 are values assigned to the variables in the vbscript language?

1 Answers  


Write a Program to add 2 numbers without using operators (+,-) and without using third variable. Note: Use VBScript only Hint: You can use other operators like '/' & '*'(Division & Multiplication)

1 Answers   Quest,


Why is it recommended to close the database connection every time after the work is completed?

1 Answers  


What is the technology used by vb script?

1 Answers  


What is Procedure or Subroutine in VB Script?

1 Answers  


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

4 Answers   Cap Gemini,


Explain the string concatenation function in vbscript?

1 Answers  


Hi anyone Can Send Solution to the Question wt m posting now Prepare Script for the Bellow Scenario? Login to Gmail Page Open Inbox check Mails save them in a Folder

1 Answers   IBM,


Mention what is the difference between vbscript and vba?

1 Answers  


What is vbscript?

1 Answers  


How to create pull down menu box using vb script

0 Answers  


Write VB script to convert from feet to inches(hint 1feet=12 inches)

2 Answers  


Categories