
Donald W. answered 04/26/22
Experienced and Patient Tutor for Math and Computer Science
You didn't specify which language to use, so I'll use C++ here:
long OutputVal(int start, int end) {
long result = 1;
for (int num = start; num <= end; num++) {
result *= num;
}
return result;
}
Note that I'm using a long internally and as a return type because multiply a lot of integers can easily overflow an int.