function [result] = par(n)
%returns the n!
    if round(n)~=n || n<0
        disp([num2str(n), ' is not a natural number'])
        result=NaN;
        return
    end
    
    if n==0
        result=1;
    elseif n<3
        result=n;
    else    
        result=1;
        for k=2:n
            result=result*k;
        end
    end



end
