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
- Difference between SQL and PLSQL
- Sum of digits of a number in PL/ SQL
- Sum of digits equal to a given number in PL/SQL
- Count no. of characters and words in a string in PL/SQL
- Reverse a number in PL/SQL
- Sum of the first and last digit of a number in PL/SQL
- Check whether a given number is even or odd in PL/SQL
- Factorial of a number in PL/SQL
- Prime number in PL/SQL
- Check if a number is Palindrome in PL/SQL
- Find the factorial of a number in pl/sql
- Centered triangular number in PL/SQL
- Greatest number among three given numbers in PL/SQL
- Check Armstrong Number in PL/SQL
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.