output sum of a range
#include <iostream>
int main() {
int start, end, sum = 0;
std::cout << "Enter the start of the range: ";
std::cin >> start;
std::cout << "Enter the end of the range: ";
std::cin >> end;
for (int i = start; i <= end; ++i) {
sum += i;
}
std::cout << "The sum of the range from " << start << " to " << end << " is: " << sum;
return 0;
}