Write a procedure and call it into main pl/sql program to find a factorial of a number.
declare
n number;
factors number:= 1;
i number;
begin
n := &n;
for i in 1..n
loop
factors :=factors *i;
end loop;
dbms_output.put_line('factorial='||factors);
end;
Comments
Leave a comment