Chapter 6: functions

Sum all numbers till the given one

Write a function sumTo(n) that calculates the sum of numbers 1 + 1 + ... + n.