C++:
#include <iostream>
int sum_range(int l, int u, int sum) {
if(l>u) return 0;
else {
for(l;l<=u;l++) {
sum+=l;
}
return sum;
}
}
int main(int argc, char* argv[]) {
int l,u,sum; std::cin>>l>>u;
std::cout << "The result: " << sum_range(l,u,sum) << std::endl;
return 0;
}