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

You may also like...

1 Response

  1. Thank you for sharing this program. This program is very helpful for me

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.