%% Repeat Statements Until Expression Is False
% Use a while loop to calculate factorial(10).

n = 10;
f = n;
while n > 1
    n = n-1;
    f = f*n;
end
disp(['n! = ' num2str(f)])

% Copyright 2015 The MathWorks, Inc.