www.itechowais.tech




 PL/SQL program to read a number and calculate its Factorial using ‘while loop’ :



set serveroutput on ;

 declare

    n number := &n ;

     fact number := 1 ;


 begin

   while (n > 0)

   loop

       fact := fact * n ;

       n := n - 1 ;

   end loop ;

     dbms_output.put_line(fact) ;

end ;

/