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, len, and revnum and assign the value in num and fin is the length of the number and after finding the length we start a loop from maximum length to starting length, we assign the num into revnum and print revnum.
Input : 123456 Output :654321
Input :87459 Output :95478
Below is the required implementation:
reverse of number is 654321.
- Comparisons between SQL vs PLSQL
- Reverse a string in PL/SQL
- Factorial of a number in PL/SQL
- Sum of digits of 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
- Prime number in PL/SQL
- Check if a number is Palindrome in PL/SQL
- Find the factorial of a number in pl/sql
- Check Armstrong Number in PL/SQL
- Count odd and even digits in a number in PL/SQL
- Centered triangular number in PL/SQL
- Sum of digits equal to a given number in PL/SQL
- Greatest number among three given numbers in PL/SQL
- DBMS | Number of possible Superkeys
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.