Write a procedure to calculate factorial of a number entered by user.
Declare
N numbaer;
temp number;
sum numbaer:1;
Begin
N:=&N;
temp:=n;
while temp>0 loop
sum:=temp*sum;
temp:=temp-1
end loop;
dbms_output.put_line('Factorial of ||n|| is sum) ;
end;
Comments
Leave a comment