Answer to Question #257611 in Databases | SQL | Oracle | MS Access for Tarurendra Kushwah

Question #257611

Write a procedure to calculate factorial of a number entered by user.

1
Expert's answer
2021-10-29T03:59:11-0400
Declare  
num   number:= #  
fact number:= 1;  
temp number;  
begin  
  temp := num;  
   while (num > 0)
loop
    fact := fact * num;  
    num   := num - 1;  
end loop;
  Dbms_Output.Put_line('factorial of ' || temp ||  '  is ' || fact);  

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS