GENERATE RANDOM NUMBER
************************************************************************
W.A.P TO GENERATE A RANDOM NUMBER
************************************************************************
JAVA Program
Output:
************************************************************************
C Program
Online Compiler
************************************************************************
C++ Program
Online Compiler
************************************************************************
C# Program
************************************************************************
PHP Program
Php is a server side scripting language.
************************************************************************
JAVASCRIPT Program
<script type="text/javascript">
// Math.random() returns a random floating point number 0 to 1
// Math.random() * (highestNumber - lowestNumber ) + lowestNumber
var x = Math.random();
console.log("Before Calculations "+ x);
x=x* (100 -1) +1;
console.log("After calculations "+x);
// Math.floor(Math.random() * (highestNumber - lowestNumber )) + lowestNumber)
let a = Math.floor(Math.random() * (100 - 1) + 1);
console.log("Floor calculation "+ a);
</script>
************************************************************************
PYTHON Program
************************************************************************
Comments
Post a Comment