// Created by Frank M. Carrano and Tim Henry. // Copyright (c) 2013 __Pearson Education__. All rights reserved. /** Computes the factorial of the nonnegative integer n. @pre n must be greater than or equal to 0. @post None. @return The factorial of n; n is unchanged. */ int fact(int n) { if (n == 0) return 1; else // n > 0, so n-1 >= 0. Thus, fact(n-1) returns (n-1)! return n * fact(n - 1); // n * (n-1)! is n! } // end fact