Notification texts go here Contact Us Buy Now!

write a pl/sql program to calculate factorial of any given number

write a pl/sql program to calculate factorial of any given number
Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated

write a pl/sql program to calculate factorial of any given number

Code

DECLARE
FACT NUMBER:=1;
V VARCHAR2(100);
BEGIN
FOR I IN 1..10
LOOP
FOR J IN 1..I
LOOP
FACT:=FACT*J;
V:=J||'*'||V;
END LOOP;
DBMS_OUTPUT.PUT_LINE(RTRIM(V,'*')||'='||FACT);
FACT:=1;
V:=NULL;
END LOOP;
END;
  

output

1=1
2*1=2
3*2*1=6
4*3*2*1=24
5*4*3*2*1=120
6*5*4*3*2*1=720
7*6*5*4*3*2*1=5040
8*7*6*5*4*3*2*1=40320
9*8*7*6*5*4*3*2*1=362880
10*9*8*7*6*5*4*3*2*1=3628800

Statement processed.
  

Getting Info...

إرسال تعليق

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.