(First problem that I was able to solve without looking at the solution!)
Write a method that takes in an integer ‘num’ and returns the sum of all integers between zero and num, up to and including ‘num’.
Basically, you want to write a simplified version of i + (i+1) + (i+2)…(i+num).
This doesn’t seem to take into account negative integers though?
Second time doing this problem, I got this:
Not as simple as my first one but it also works.