Prerequisite – PL/SQL introduction
In PL/SQL code groups of commands are arranged within a block. A block group related declarations or statements.
In declare part, we declare variables and between begin and end part, we perform the operations.
Here, first, we take three variables num, fact, and temp and assign the value in num variable (i.e which number factorial we want).
And then after we assign fact variable to 1.
Input : 4 Output : 24
Input : 6 Output : 720
Below is the required implementation:
factorial of 6 is 720.
- Comparisons between SQL vs PLSQL
- Program for factorial of a number
- Find the factorial of a number in pl/sql
- One line function for factorial of a number
- Given number of matches played, find number of teams in tournament
- Find the number of ways to divide number into four parts such that a = c and b = d
- Find count of digits in a number that divide the number
- Count Number of animals in a zoo from given number of head and legs
- Program to check whether the given number is Buzz Number or not
- Immediate smallest number after re-arranging the digits of a given number
- Check if a number has same number of set and unset bits
- Round-off a number to a given number of significant digits
- Check if a number is a Krishnamurthy Number or not
- Check Whether a number is Duck Number or not
- Find the other number when LCM and HCF given
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.