You are on page 1of 1

3/9/21 12:37 PM D:\Matlab\mme\factorial.

m 1 of 1

N = input('Enter a number of terms required = ');


s=1;
if N>=0
for i=1:N
s=s*i;
end
disp('The factorial is = ')
disp(s)
else
disp('Not Possible')
end

You might also like