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 a number and task is to find the number of odd and even digits present in the number.
Input: 123456 Output: Odd digits = 3 Even digits = 3 Input: 246 Output: Odd digits = 0 Even digits = 3
Approach is to take a number and one by one check its digts, if it is odd or even.
Below is the required implementation:
Odd Digits: 3 Even Digits: 3
- Sum of digits of a number in PL/ SQL
- Sum of digits equal to a given number in PL/SQL
- PLSQL | COS Function
- PLSQL | CHR Function
- PLSQL : || Operator
- PLSQL | LN Function
- PLSQL | EXP Function
- PLSQL | LEAST Function
- PLSQL | LOG Function
- PLSQL | TAN Function
- Difference between SQL and PLSQL
- PLSQL | MOD Function
- PLSQL | ABS Function
- PLSQL | SIN Function
- PLSQL | LENGTH Function
- PLSQL | LTRIM Function
- PLSQL | INSTRC Function
- PLSQL | LPAD Function
- PLSQL | LENGTHB Function
- PLSQL | LENGTH4 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 firstname.lastname@example.org. 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.
Improved By : Akanksha_Rai