How to code for addition of in between numbers.

How to I code that I get the user to input a start number (e.g. 2) and an end number (e.g. 15) and cause it to add up all the number in between? (e.g. 2+3+4+5+6+7+8+9+10+11+12+13+14+15)
you have to convert the arithmetic progression formula into C++:
https://en.wikipedia.org/wiki/Arithmetic_progression
Thank you
Topic archived. No new replies allowed.