8 lines
147 B
Matlab
8 lines
147 B
Matlab
function printfaculty(n)
|
|
% compute the faculty of n and print it
|
|
x = 1;
|
|
for i = 1:n
|
|
x = x * i;
|
|
end
|
|
fprintf('Faculty of %i is: %i\n', n, x)
|
|
end |