PL/SQL Program to Find Factorial of Number

PL/SQL Program to Find Factorial of Number :



declare
no number;
fact number:=1;
i number;
begin
no:=:no; 
for i in 1..no
loop
fact:=fact*i;
end loop;
dbms_output.put_line('Factorial of '||no||' is '||fact);
end;

OUTPUT:

Factorial of 5 is 120




Leave a Reply

Your email address will not be published. Required fields are marked *

3 × one =