Calculate the sum of all integers from 15 to 25 inclusive.
Note
There are 11 terms; sum = n × (first + last) / 2 = 11 × (15 + 25) / 2 = 11 × 40 / 2 = 11 × 20 = 220.
Calculate the sum of all integers from 15 to 25 inclusive.
There are 11 terms; sum = n × (first + last) / 2 = 11 × (15 + 25) / 2 = 11 × 40 / 2 = 11 × 20 = 220.