<script> function myRandom(a,b) { return a+Math.random()*(b-a); } function myRandom2(a,b,c) { powc=Math.pow(10,c); r1=a+Math.random()*(b-a); return Math.round(powc*r1)/powc;; } function intRandom(a,b) { return Math.round(a+Math.random()*(b-a)); } r1=myRandom(1,10); r2=myRandom2(1,10,2); r3=intRandom(1,10); document.write("A random number between 1 and 10: ====> ", r1); document.write("<br>"); document.write("A random number between 1 and 10: ====> ", r2); document.write("<br>"); document.write("A random integer between 1 and 10: ====> ", r3); document.write("<br>"); document.write("<hr>"); r1=myRandom(70,150); r2=myRandom2(70,150,1); r3=intRandom(70,150); document.write("A random number between 70 and 150: ====> ", r1); document.write("<br>"); document.write("A random number between 70 and 150: ====> ", r2); document.write("<br>"); document.write("A random integer between 70 and 150: ====> ", r3); document.write("<br>"); document.write("<hr>"); </script>