Let n be a natural number, n! = 1 * 2 * 3 *... * (n-1) * n be called the factorial of N, and 0! = 1. Try to write a program to calculate 2, 4, 10! And output the result This problem is java programming!

Let n be a natural number, n! = 1 * 2 * 3 *... * (n-1) * n be called the factorial of N, and 0! = 1. Try to write a program to calculate 2, 4, 10! And output the result This problem is java programming!

function y = tapmulti(cnt)
y = 1;
if cnt ~= 0
for i0 = 1:cnt
y = y*i0;
end
end
end
Another program uses
cn1 = tapmulti(2)
cn2 = tapmulti(4)
cn3 = tapmulti(10)