Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to add up all the numbers in between 0 and that number

function solution(number){
  var sum = 0;
  
  for(var i = 1;i< number; i++){
    if(i % 3 == 0 || i % 5 == 0){
      sum += i
    }
  }
  return sum;
}
 
PREVIOUS NEXT
Tagged: #add #numbers #number
ADD COMMENT
Topic
Name
6+5 =