By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,541 Members | 1,105 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,541 IT Pros & Developers. It's quick & easy.

Random Number

P: 16
Hi,

How to generate a random number between 1 to 4. Can someone give me the code.

Regards,
Kamal
Jan 12 '07 #1
Share this Question
Share on Google+
1 Reply


10K+
P: 13,264
Hi,

How to generate a random number between 1 to 4. Can someone give me the code.

Regards,
Kamal
Math.random() generates a double between 0 and 1. Play around with it to get what you want
Jan 12 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.