Print Patterns in PL/SQL
You have given a number n then you have to print number a right-angled pyramid of *
Examples:
Input : 3 Output : * ** *** Input : 7 Output : * ** *** **** ***** ****** *******
declare -- declare variable n, i and j-- of datatype number n number : = 7; i number; j number; begin -- loop from 1 to n for i in 1..n loop for j in 1..i loop -- printing * dbms_output.put('*'); end loop; -- for new line dbms_output.new_line; end loop; end; --Program End |
chevron_right
filter_none
Output:
* ** *** **** ***** ****** *******
Recommended Posts:
- Print different star patterns in SQL
- Programs to print Interesting Patterns
- Program to print right and left arrow patterns
- Recursive program to print triangular patterns
- Program to print diagonal star patterns
- Program to print solid and hollow rhombus patterns
- Programs to print Triangle and Diamond patterns using recursion
- Program to print solid and hollow square patterns
- Program to print hollow rectangle or square star patterns
- PLSQL | SIN Function
- PLSQL | COS Function
- PLSQL | LOG Function
- PLSQL | CHR Function
- Difference between SQL and PLSQL
- PLSQL | ABS 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 contribute@geeksforgeeks.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.




