CoderZone.org

Category: >> JavaScript >> Generate Random Numbers Bookmark and Share

<< lastnext >>

Snippet Name: Generate Random Numbers

Description: This will generate random numbers.
It pick's a number less than the defined number and then show that number to the power up to itself in repetition.

Comment: (none)

Author: CoderZone
Language: JAVASCRIPT
Highlight Mode: JAVASCRIPT
Last Modified: December 03rd, 2010

<script type="text/javascript">
/* create 2 variables */
var m, n;
 
/* defined number */
n = 10;
 
/* determine m ... */
m = Math.floor(Math.random() * n + 1);
for (i = 1; i <= m; i++){
  document.write(Math.pow(m,i));
  document.write("<br>");
}
</script>
 
 
There haven't been any comments added for this snippet yet. You may add one if you like.  Add a comment 
© coderzone.org | users online: 7