Write a method that takes an integer ‘n’ in; it should return n*(n-1)*(n-2)*…*2*1. Assume n >= 0.
As a special case, ‘factorial(0) == 1’.
Turned out I didn’t actually need the elsif statement as result would default back to 1 (since it was initialized as result = 1) when n is not > 0.
Also, note to self: only use multiple ‘if’ statements if you want more than 1 condition to be true. Otherwise, use elsif to ensure that only one condition is executed.