![]() |
You have given a number n then you have to print the number in a right-angled pyramid of * Input : 3
Output :
*
**
***
Input : 7
Output :
*
**
***
****
*****
******
*******
C
Output: *
**
***
****
*****
******
*******
A pattern of any shape can be generated by specifying the number of rows and column along with symmetry and regularity. To form a 2D shape one variable is iterated over the other to form the desired pattern. Square Pattern using PL/SQLTo print a square pattern inner loop is iterated for the same number of times as the outer loop.
C
Input![]() Input Output: ![]() Output Explanation: For the above example, the inner loop is iterated over the outer for the same number of times. Input for the instance is 5 hence the square pattern is displayed with 5 rows and columns . Rectangle Pattern with PL/SQLTo form a rectangular pattern inner loop is iterated for different number of times than the outer loop. Inner loop indicate the number of columns and the outer loop as number of rows in the rectangle.
C
Rectangle Pattern Output![]() Rectangle Pattern Output Conclusion:Pattern are generated using nested loops .A pattern of any shape can be generated by specifying the number of rows and column along with symmetry . It enhances coding proficiency and enables creative design. |
Reffered: https://www.geeksforgeeks.org
SQL |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 9 |