Untitled

mail@pastecode.io avatar
unknown
plain_text
20 days ago
280 B
2
Indexable
Never
 CREATE OR REPLACE function fact(num IN int)
 return int
 AS
 f int;

 begin
 f:=1;
 for i in 1..num loop
   f:=f*i;
 end loop;
 return f;
 end fact;
 /

declare
num int:=&1;
res int;
begin
res:=fact(num);
dbms_output.put_line('FACTORIAL IS:'||res);
end;
 /
Leave a Comment