Wap to generate a javascript to generate 5000 random numbers
Answers
Answered by
1
function randFiveThousand() {
var result = '';
for (var i = 0; i <= 5000; i++) {
result += Math.floor(Math.random() * 5000) + 1 + '\n';
}
console.log(result);
}
randFiveThousand();
when you will execute this program in browser console you will get 5000 times random numbers will be printed.
var result = '';
for (var i = 0; i <= 5000; i++) {
result += Math.floor(Math.random() * 5000) + 1 + '\n';
}
console.log(result);
}
randFiveThousand();
when you will execute this program in browser console you will get 5000 times random numbers will be printed.
Answered by
0
Answer:
Hey this is in JavaScript...
for (let i=0; i<5000; i++){
document.write(Math.random() + '<br/>')
}
// Hope this helps!!
Similar questions
English,
8 months ago
Physics,
8 months ago
Science,
1 year ago
Psychology,
1 year ago
Math,
1 year ago