Skip to main content

Intermediate Algorithm Scripting – Sum All Numbers in a Range – Free Code Camp

By Uncategorized

In this intermediate algorithm scripting tutorial, we write code that finds the sum of all numbers in a range. That range is passed in via an array which may not be in order. First we find the lower of the two number. Then find the higher of the two. Finally, we loop through from the lower number to the higher number. As we loop through the numbers, we add them all together to find the sum of all numbers in that range. This is part of a series where I make a tutorial for each of the free code camp (www.freecodecamp.org) curriculum lessons. Enjoy!

Leave a Reply