Computer Science, asked by HaasinQureshi1165, 1 year ago

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 weill execute this program in browser console you will get 5000 times random numbers will be printed.
Similar questions