Computer Science, asked by snehaknair910, 1 year ago

Wap to generate a javascript to generate 5000 random numbers

Answers

Answered by Anonymous
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.
Answered by gaganadithyareddy9
0

Answer:

Hey this is in JavaScript...

for (let i=0; i<5000; i++){

       document.write(Math.random() + '<br/>')

   }

// Hope this helps!!

Similar questions