How to get only random number between 1 and 100?

 Posted by Rajesh_Kumar on 2/17/2014 | Category: JavaScript Interview questions | Views: 1864 | Points: 40
Answer:

Just multiply with 100,then we can get output between 1 to 100 as

alert(Math.floor((Math.random() * 100)));


Output would be any value between 1 and 100.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response