sql求阶乘
Here you will get pl/sql program to find factorial of a number.
在这里,您将获得pl / sql程序来查找数字的阶乘。
We can calculate factorial of a number by multiplying it with all the numbers below it.
我们可以通过将数字乘以其下所有数字来计算阶乘。
For example factorial of 5 = 5 x 4 x 3 x 2 x 1 = 120.
例如5的阶乘= 5 x 4 x 3 x 2 x 1 = 120。
PL / SQL程序查找数字的阶乘 (PL/SQL Program to Find Factorial of a Number)
declare
n number;
fac number:=1;
i number;
begin
n:=&n;
for i in 1..n
loop
fac:=fac*i;
end loop;
dbms_output.put_line('factorial='||fac);
end;
/
Output
输出量
Enter value for n: 10 old 7: n:=&n; new 7: n:=10; factorial=3628800
输入n的值:10 旧7:n:=&n; 新7:n:= 10; 阶乘= 3628800
翻译自: https://www.thecrazyprogrammer.com/2016/09/plsql-program-find-factorial-number.html
sql求阶乘
PL/SQL阶乘程序
本文提供了一个PL/SQL程序,用于计算输入数字的阶乘。通过将数字与其以下的所有整数相乘,可以得到阶乘的结果。示例中演示了如何使用此程序计算10的阶乘。
3272

被折叠的 条评论
为什么被折叠?



