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.
Given two numbers and task is to find the GCD (Greatest Common Divisor) or HCF (Highest Common Factor) value of the numbers.
Input: num1 = 4, num2 = 6 Output: gcd of (num1, num2) = 2 Input: num1 = 8, num2 = 48 Output: gcd of (num1, num2) = 8
Approach is to take two numbers and find their GCD value using Euclidean algorithm.
Below is the required implementation:
GCD of 8 and 48 is 8
- PLSQL | TAN Function
- PLSQL | CHR Function
- PLSQL | LEAST Function
- PLSQL | EXP Function
- PLSQL | ABS Function
- PLSQL | LN Function
- PLSQL : || Operator
- PLSQL | COS Function
- PLSQL | LOG Function
- PLSQL | MOD Function
- Difference between SQL and PLSQL
- PLSQL | SIN Function
- PLSQL | SQRT Function
- PLSQL | RPAD Function
- PLSQL | UPPER Function
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.