Let’s get this started by the instructions posted by Ken:
” Write a program that asks for a range of integers and then prints the sum of the numbers in that range (inclusive).
You can use a formula to calculate this of course but what we want you to do here is practice using a loop to do repetitive work.
For example, the sum from 6 to 10 would be 0 + 6 + 7 + 8 + 9 + 10 ”
Here is the code written on Atom:
Here is the code running on Terminal:
I made some tests with different values and here are the results; I even put 10 and 10 to see what the result was…for my surprise it is 10.