Hi, I'm working on this code right now. The first method returns the factorial of an integer (factorial of 3 = 1x2x3). And the second returns the sum of the factorials between 2 integers. This is correct according to my professor. I'm just confused as to why in the 2nd methods it isn't "total = total + Factorial(i);" instead of what I have.
thanks for the help.
public class LoopProblems { public int Factorial (int n){ int total = 1; for (int i = 1; i <= n ; i++ ) { total = total * i; } return total; } public int SumOfFactorials (int start, int end) { int total = 1; for (int i = start; i <= end ; i++ ) { total = total * Factorial(i); } return total; } }