%  Code to compute n factorial.  User enters n.
n = input(' Enter n: ');

nfact = n;
for i=n-1:-1:2,
  nfact = nfact*i;
end;
nfact
