Look upby unseenmachine (no login)
Firstly, clippys right, i cant give you code, however i can point you in the right direction.
Look in the wiki, or qb helpfile if your using original qbasic for the following
For the counting up to the number bit, use could use a FOR loop. Start at 1 and loop until your random number is reached.
Have a go and post your code, then i can help more.