n = 5; counter = 1; x = 1; while counter <= n x = x * counter; end fprintf('Faculty of %i is: %i\n', n, x)