hosamshahin
5/20/2016 - 5:06 PM

CodeWorkout: Factorial

public int factorial(int n)
{
    int result = 1;
    for (int i = 1; i <= n; i++) {
        result = result * i;
    }
    return result;
}