function [y]=fac(n) 
% y=fac(n) 
% computes n factorial (demonstrate a recursive function call)
% n should be a positive integer

%       S.Halevy 7/31/92
%       Copyright (c) 1992 by the MathWizards

if (n<=1) 
    y=n; 
    return
end

y=n*fac(n-1);

