function y = fact_rec(x)
% FACT_REC Calculates the factorial using a recursive call
%   y = fact_rec(x)
%
%   x: a positive integer
%   y: x's factorial

if x == 0 | x == 1
    y = 1;
else
    y = x * fact_rec(x-1);
end
