Thursday, April 23, 2020

Program to print numbers from 0 to 50 in JavaScript



  1. var printFiftyNumbers() {
  2. var text = "";
  3. var i;
  4. for(i=0; i <= 50; i++) {
  5. text += i + "<br>";
  6. }
  7. document.getElementById("demo").innerHTML = text;
  8. }

No comments:

Post a Comment