Javascript for Statement Question 9

Introduction

Print Sum 0 - 255

Print integers from 0 to 255, and the sum so far.

function sum255() {
  var sum = 0;
  //your code here
  return sum;
}
sum255();


function sum255() {
  var sum = 0;
  for (var i = 0; i <= 255; i++) {
    sum += i;
  }
  return sum;
}
sum255();



PreviousNext

Related